My observation:
If I open a new terminal (gnome/lx):
- New /dev/pts/X is used
whodoes not lists these- First character of
echo $0is not-, so its not a login-shell.
If I
sshinto the same machine with the same user- New /dev/pts/X is used
wholists these- First character of
echo $0is-, so its a login-shell.
If I open a new tty (ctrl-alt-Fxx)
- New /dev/ttyXX is used
wholists these- First character of
echo $0is-, so its a login-shell.
If I run
su -- Same /dev/pts/X is used ( where
su -was issued ) whodoes not list these- First character of
echo $0is-, so its a login-shell.
- Same /dev/pts/X is used ( where
Conclusion:
- Creating a new pty does not automatically create an entry in utmp (?)
Question:
- If
whodisplays the list of currently logged in users, then it should display entries for each login-shell (?). But it does not display entries of root user logged in fromsu -, why ?
EDIT: Another thing which I can conclude at this point is: "It has to be a new pty/tty and a login shell, then only a new entry is created in utmp"
who– P Pang Aug 25 '17 at 07:25