Re: sudo su

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/29/2017 12:17 PM, fred roller wrote:
> 
>> On 05/27/2017 10:12 PM, fred roller wrote:
>>> you could run "who" to see if the root user is still logged
> on as well.
>>
>> I have a terminal open, logged in as root with su -.  When I
> ran who, it
>> just showed me, logged in once and no root.  Checking with
> uptime, it
>> shows one user.
> 
> I never heard of 'who' ;-) Unfortunately, it is true: I ran
> 'su -' and then who in another tab and in a different terminal
> emulator and it showed no root nor me as root, just me.
> 
> True, you will see the multiple instances of your log-in and their
> "terminal".  "tty" for your graphics and "pts" for terminal emulators.
> Open multiple tabs in your cli emulator and run who and you will what I
> am talking about. Running sudo invokes root privileges for your user,
> hence, no root user just your user.  You would have to set root pw and
> actually log-in with root to see the root log in.  I apologies for the
> ambiguity.

"who" shows you who is currently logged in (based on data from
/var/run/utmp or /var/log/wtmp). Since the other "su -" sessions were
spawned from the initial user's shell, "who" only shows that initial
login user since that's the only user who actually logged in and has
data in utmp or wtmp. Remember that "su -" or "sudo -i" do NOT actually
perform logins--they fork a process and run the shell in that process
handing it flags that make it ACT like a login shell.

If you do a "ps flax" and track things, you'll see that the bash
sessions with the UID of root all have parent processes that are "su -"
programs, which were in turn run by the initial logged-in user. You'll
also find their process names are "-bash" and not "bash".
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks@xxxxxxxxxxxxxx -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-            We look for things.  Things that make us go!            -
-                                -- The "Paclyds", Star Trek TNG     -
----------------------------------------------------------------------
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux