Asking because of curiosity. :)
When I type
It asks for my user password. And when I type just
It asks for the root user password. But both the commands directs me to the root terminal. Then why is there such a difference?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
sudo su means run the command
sudo which means as root. Here the system will ask you for your password since you are a sudoer. After you enter your password, you now have root privileges. So
su command won't ask for a password. It's same as if you are a root then
su to any other user will not ask for password because you are a root.
When you just run the command
su, you are running it as a regular user. Since
su means switch to user root, you will be asked for the root password.