Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I log in as root from gnome-terminal using the command:

sudo su

it logs me in as the root user.

Isn't this switching a user considered as a log in?

Also, which command can show me all the "switching" I have done?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

First, let's take a look at man who:

Print information about users who are currently logged in.

As you said,

sudo su it logs me as root user

So, it's about you, not about root.

And you are right. This is from man sudo:

sudo allows a permitted user to execute a command as the superuser or
another user, as specified by the security policy.

So, again, when you run sudo su command, in fact you (not root) are executing su command as the superuser.

If you want to became root, first you must to enable root account. See here how to do this:

After this you can login with root in tty1-6, via ssh, in GUI at the login screen, etc.

In Ubuntu it seems that there is an alternative to get root logged without to enable his account. The following command will do this:

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gnome-terminal

This will open a root terminal:

root terminal

Related to the second question, I give you a hint: look in /var/log directory for files like auth.log.*.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.