Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: dum question about users, terminals and so on

  1. #1
    Join Date
    Oct 2009
    Location
    Taura, Germany
    Posts
    287

    Default dum question about users, terminals and so on

    Hi there,

    I have a maybe stupid question regarding users and terminals. Just to understand the system a bit better.

    I know that when you open a terminal (console), there is another user logged into the system, even when you do just normal stuff, without roor privilegues. When you exit this console, the user is logged out again.

    But on my systems (Desktop and Laptop) there are always two users logged in, even when it is just me (the normal user) and no terminal, no console is opened. When I open a console, then there are three users...

    when I look the users up in a terminal, it shows me twice:

    Code:
    steffen  pts/0                         Sat Apr 30 11:09   still logged in
    steffen  pts/1                         Sat Apr 30 08:46   still logged in   
    steffen  console      :0               Sat Apr 30 08:46   still logged in
    so the one with "pts/0" is the one from the terminal, which is opened right now.

    As far as I recall, in Ubuntu (in my earlier Linux life) I always had one user, and when I opened a terminal, I had 2 users...

    from what is the 2nd "normal user" in openSUSE?

    so first of all, this is to understand the system better, but it also to see: is everything alright with my system?

    thanks for some answers on this!

    regards
    Steffen
    Desk: HP Pavilion, Nvidia GeForce GTX460, Atheros Wlan, openSUSE 12.1 KDE 4.7.2, Win7
    Lap: Sony Vaio VPCEB3J1E, Intel GMA 3500, Intel Wlan, openSUSE 12.1 KDE 4.7.2
    Netty: HP Mini 3530, Xubuntu 11.10

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,795

    Default Re: dum question about users, terminals and so on

    It is the same user, but there are more sessions. I first thought you were worrying about another user loged in. Happily this is not the case.

    IIRC this question was asked before, but I can not clearly remember all the details.
    You did not show the statement with which you got the above output. That would have helped other people to do likewise to check if they have the same without searching in the deepest of their memory.
    Henk van Velden

  3. #3
    Join Date
    Oct 2009
    Location
    Taura, Germany
    Posts
    287

    Default Re: dum question about users, terminals and so on

    Quote Originally Posted by hcvv View Post
    It is the same user, but there are more sessions. I first thought you were worrying about another user loged in. Happily this is not the case.

    IIRC this question was asked before, but I can not clearly remember all the details.
    You did not show the statement with which you got the above output. That would have helped other people to do likewise to check if they have the same without searching in the deepest of their memory.
    but why are there more sessions? Is it something with all the runlevel stuff? So that when I boot up the system, I have the system running, which runs without GUI and the GUI on top of it with another user (myself again)?

    the command for getting the information in the terminal was

    Code:
    last
    which shows all of the last logins by every user on the machine.
    Desk: HP Pavilion, Nvidia GeForce GTX460, Atheros Wlan, openSUSE 12.1 KDE 4.7.2, Win7
    Lap: Sony Vaio VPCEB3J1E, Intel GMA 3500, Intel Wlan, openSUSE 12.1 KDE 4.7.2
    Netty: HP Mini 3530, Xubuntu 11.10

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,795

    Default Re: dum question about users, terminals and so on

    I have the same on 11.2:
    Code:
    henk@boven:~> last | grep still
    henk     pts/1                         Sat Apr 30 21:37   still logged in
    henk     pts/0                         Sat Apr 30 10:15   still logged in
    henk     :0           console          Sat Apr 30 10:14   still logged in
    henk@boven:~>
    Thus your system is not abnormal.

    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.

    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).

    This certainly is not the whole answer. Let us hope someone else will tune in.
    Henk van Velden

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: dum question about users, terminals and so on

    On 2011-04-30 20:36, steffen13 wrote:
    > when I look the users up in a terminal, it shows me twice:


    And my 27 times. Normal.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: dum question about users, terminals and so on

    On 2011-04-30 21:36, steffen13 wrote:
    > which shows all of the last logins by every user on the machine.


    Not really. My user has 301 entries there.
    They are historic entries.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  7. #7
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,675
    Blog Entries
    3

    Default Re: dum question about users, terminals and so on

    Here's more detail than you ever wanted to know

    Normally, when somebody logs in, a record is written to "/var/run/utmp".

    When you list who is logged in, what you are listing is based on that "utmp" file.

    When you login to the display manager (a GUI session), then a record is written to "utmp" showing the terminal as ":0", which really isn't a terminal (it's the display). When you open a command line terminal, normally a record is written to "utmp". It is actually possible to open a command prompt with the command:
    xterm -ut
    and that won't write a record to "utmp".

    Your question was about the record for terminal "pts/1". If I do:
    ps -ft pts/1
    it doesn't show anything connected to that terminal. If, however, I use the command:
    lsof /dev/pts/1
    it does show a connected process, which shows in the process listing as "kdeinit4: kded4 [kdeinit]"

    I suspect (but haven't tested), that if somebody tried to open a talk session to me on pts/1, that would be trapped by kded4 and a popup would display indicating that there is a talk request. Hmm, kded4 seems to be a KDE daemon. Perhaps if I used gnome or XFCE, I would not see that utmp entry.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  8. #8

    Default Re: dum question about users, terminals and so on

    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):
    Code:
    --------------------
    > who

    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:
    Code:
    --------------------
    > w

    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.

  9. #9

    Default Re: dum question about users, terminals and so on

    You're running in a multi-user environment.
    IMHO, some communication operations for security reasons run in separate sessions to insulate those sessions from other sessions, ie, closing terminals doesn't close other terminals.
    FWIW, you'd see 2 or 3 or more users with other users on your system running terminals, console (GUI), apps, etc.
    Box 1: OpenSuse 11.1/Win7 | Linux 2.6.27 Gnome | AMD 64 X2 6000+ | nVidia 8600GT | 2GB RAM
    Box 2: OpenSuse 11.2 | Linux 2.6.31 Gnome | AMD 64 3000+ | ATI X800 Pro | 1GB RAM
    Box 3: Win7 Premium Home | Intel P4 3.0Gz | ATI AIW 2006 | 2GB RAM

  10. #10
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,675
    Blog Entries
    3

    Default Re: dum question about users, terminals and so on

    Quote Originally Posted by nrickert View Post
    Perhaps if I used gnome or XFCE, I would not see that utmp entry.
    I just tested that with XFCE and with ICEwm. In both cases the list of logged in users contained only two entries. One was for ":0" (the desktop session), and the other was for the xterm that I had open to run the "who" command. So the additional entry appears to be a KDE special.

    I didn't test gnome. The comment about ubuntu in the opening post suggests that gnome does have that extra entry either.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •