When you boot the system, no user is loged in. Users log only in after the system is booted fully. That can be done automaticaly, some users prefer that a GUI session is started for a specific user without further user identification. But that automatic login is configured to be there and can of course only work for one of the configured users. The result is not different from that user loging in with username/password in KDM/GDM.
Autologin has nothing to do with this ?
I can not find any process in the process list that is connected to pts/0.
I guess it is some “trick” to have the internal administration working. Like the whole pts/pty device is a trick to let virtual terminals function (originaly there were of course real tty devices).
The pts/* entries are indeed virtual terminals (‘psuedoterminals’). For every login console you open you get a new tty or pts/* opened for your user. You can get ‘real’ tty’s on the virtual terminals (vt) 1-6 (Ctrl-Alt-F1 to F6). If a program (e.g., a DE like KDE) wants to open a new terminal its opens a pts.
The ‘who’ command tells you who is currently logged in at which terminals. ‘last’ is basically just a history of ‘who’.
If you want to know what processes have opened these virtual terminals, try using lsof (the pts’s and tty’s exist as actual files in /dev):
For example on my system, with one console open (yakuake) and also logged in on VT1 (Ctrl-Alt-F1):
tejas tty1 2011-04-30 21:50
tejas :0 2011-04-30 09:38 (console)
tejas pts/0 2011-04-30 09:38
tejas pts/1 2011-04-30 09:38
> lsof | grep /dev/pts/0
kded4 3995 tejas 25u CHR 136,0 0t0 3 /dev/pts/0
kded4 3995 4000 tejas 25u CHR 136,0 0t0 3 /dev/pts/0
kded4 3995 4035 tejas 25u CHR 136,0 0t0 3 /dev/pts/0
kded4 3995 4047 tejas 25u CHR 136,0 0t0 3 /dev/pts/0
> lsof | grep /dev/pts/1
yakuake 4175 tejas 11u CHR 136,1 0t0 4 /dev/pts/1
yakuake 4175 4178 tejas 11u CHR 136,1 0t0 4 /dev/pts/1
bash 4179 tejas 0u CHR 136,1 0t0 4 /dev/pts/1
bash 4179 tejas 1u CHR 136,1 0t0 4 /dev/pts/1
bash 4179 tejas 2u CHR 136,1 0t0 4 /dev/pts/1
bash 4179 tejas 255u CHR 136,1 0t0 4 /dev/pts/1
lsof 23171 tejas 0u CHR 136,1 0t0 4 /dev/pts/1
lsof 23171 tejas 2u CHR 136,1 0t0 4 /dev/pts/1
grep 23172 tejas 1u CHR 136,1 0t0 4 /dev/pts/1
grep 23172 tejas 2u CHR 136,1 0t0 4 /dev/pts/1
In fact in the last example, you can see that the terminal I am looking at is the one where I typed the lsof command!
The ‘w’ command gives a quicker summary of this:
21:50:53 up 12:25, 4 users, load average: 0.13, 0.20, 0.40
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
tejas tty1 21:50 48.00s 0.60s 0.60s -bash
tejas :0 09:38 ?xdm? 1:42m 0.10s /bin/sh /usr/bin/startkde
tejas pts/0 09:38 12:12m 0.00s 2:09 kdeinit4: kded4 [kdeinit]
tejas pts/1 09:38 0.00s 1.34s 0.00s w
again, the last entry is the terminal where I actually ran the ‘w’ command, the first one is me logged in on VT1, and the next two are KDE.
So basically the summary is, unix/linux is truly a multiuser system, and so each time you open a new console (even within a DE), you are actually logging in again. This is all the multiple user entries mean.