-1

I want to setup my SSH connection correctly. As many tutorials told me, it is not recommended to use the root account of Ubuntu server. So I would rather use my standard account "Simon" to upload files and transfer terminal commands.

When I run 'sudo su' I am prompted to type the standard password for my user account Simon in order to gain root permissions. I am pretty sure, that instead I should get asked for the root password, shouln't I? How can I fix this?

closed as off-topic by Ward, Jenny D, HBruijn Apr 4 '16 at 11:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

8

No, you should not.

If you were to type "su", then that would be true, you should be asked for the root password. Su basically means "switch user".

Sudo authenticates the logged in user again to make sure you did not leave the terminal open in order to allow you to use the permissions given to you via the sudo configuration (/etc/sudoers, /etc/sudoers.d/*).

As such, you cannot fix it because that is the desired behavior. If you still want the behavior you are describing to want/need, sudo has a configuration option called runaspw.

Also, try not using sudo su but rather, "sudo whatever command I'd like to run as root".

  • So just to be sure: If I type sudo, I will always obtain rights to change everything on the system, whether or not there exists a root account on my system? So in case I type "sudo su" and I entered my user password correctly I will obtain god priviliges, so that I can skip the password of root. Then it would be the best to disable the root account and always use sudo? Thank you for your support. – user346912 Apr 2 '16 at 14:00
  • 4
    A root account cannot not exist. sudo does not necessarily switch you to the root account, I recommend you to read its documentation to understand what it does. If you type "sudo su", you will get a shell with root as process owner so you will get root privileges. You cannot disable the root account, but you can disable its password so that nobody is able to directly use it using a password. – Florin Asăvoaie Apr 2 '16 at 14:17

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