When I log in as root from gnome-terminal using the command:
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?
First, let's take a look at
Print information about users who are currently logged in.
As you said,
sudo suit logs me as root user
So, it's about you, not about root.
And you are right. This is from
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:
Related to the second question, I give you a hint: look in
/var/log directory for files like