Background
I know the difference between su -
, sudo su -
, and sudo <command>
:
su -
- switches user to root, requires the root passwordsudo su -
- switches user to root, requires only the current user's passwordsudo <command>
- grants root access only for a specific command; requires only the current user's password
My question is about whether or not using sudo su -
is a safe practice in a production environment.
Some thoughts:
It seems like allowing
sudo su -
poses a security risk by making access to the root account dependent upon individual user passwords. Of course, this might be mitigated by enforcing a strict password policy. I don't thinksu -
is any better since it would require the administrator to share the actual root password.Allowing users to completely switch to the root account makes it more difficult to keep track of who makes changes to the system. I've seen cases at my day job where multiple users are given
sudo su -
access. The first thing the users do when logging into the system is runsudo su -
, before beginning work. Then, one day something breaks, and there is no traceability to who ranrm -rf *
in the wrong directory.
Questions
Given the above concerns, is it ever a good idea to allow users to use sudo su -
or even su -
at all?
Are there any reasons an administrator would configure user accounts for sudo su -
or su -
instead of sudo <command>
(aside from laziness)?
Note: I am ignoring the case where the user running sudo su -
or su -
is the Administrator needing to make system changes, when direct ssh access has been disabled for the root user.