I was reading that in Ubuntu for security reasons root is disabled / has no password set, hence we cannot su into it. How this is increasing security if one could simply do sudo su and gain identical permissions?


I think you have a slight misunderstanding -

root is generally disallowed to login via SSH, but is still a valid user once on the machine.

When executing simply su, a user will be prompted for the root user's password in order to continue; sharing a password like this is bad practice.

If a specific user has access to sudo su, then only that named / user my become root. Again, sudo su will only work for the users / groups that are explicitly defined in /etc/sudoers.

The this link on why allowing root over SSH is bad practice.

  • Thanks Matt for commenting and although I agree regarding SSH different arguments were used, for example. If you are user X you won't be able to switch to root using su as it has no password set, at least in Ubuntu. Because you won't be able so say you will be able to delete only your data but no the data of other users. But this doesn't make sense to me. Say I'm able to brute force user's X password what will prevent me from gaining ultimate rights using sudo su? – cyzczy Jun 8 '17 at 20:24
  • If user X is not in the sudo group, then you won't be able to gain root access. Simple as that. Besides, sudo su for root access is handy when having multiple administrators so, as said in the above post, you avoid sharing a single root password among users. Everyone just has to know their own password. – user633551 Jun 8 '17 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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