Interview Prep/Linux/Permissions, Users & sudo

sudo vs su: what's the difference?

BeginnerConceptPermissions, Users & sudo
Answer

su switches to another user and needs that user's password (root's password for su -). sudo runs a command using your own password, per-command, with fine-grained rules and an audit trail. In production root passwords are locked and admins use sudo. su - (or sudo -i) gives a login shell with the target's environment; plain su keeps much of yours.

All Linux questions Roadmap: Linux

More on Permissions, Users & sudo