I know the difference between
sudo su -, and
su -- switches user to root, requires the root password
sudo su -- switches user to root, requires only the current user's password
sudo <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.
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 think
su -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 run
sudo su -, before beginning work. Then, one day something breaks, and there is no traceability to who ran
rm -rf *in the wrong directory.
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.