sudo allows to run privileged commands without logging in as the root user, thus avoiding the “root session left open” syndrome.

It also allows sharing administrative access to a machine without sharing the root password, logging etc.


  1. Install the sudo package.
$ su -c "apt-get update"
$ su -c "apt-get install sudo"
  1. Add admin users to sudo group
$ su -c "usermod -aG sudo <user>"
  1. Logout, login again, and test
$ sudo whoami