How can users have root (administrative) privileges in Linux, Unix without knowing the root password? One of the best answers to this question is sudo. Users login using their username and password and issue administrative commands placing sudo in front of the commands, e.g. sudo rpm -Uvh *.rpm , to run the command which installs and updates programs in Linux (rpm). For more details see this introduction to sudo from its authors. To create the file which assign administrative privileges to users -- the sudoers file, please read the sudoers documentation page.
Using sudo in Linux: a mini tutorial
This mini-tutorial focuses on the easiest way a user can use the administrative privileges assigned to him/her by the sudoers file, without knowing the root password.
Open a shell window
- at the bash shell prompt $ type sudo -v
- Linux will ask you for a password -- enter the password of your account For the next 5 minutes it will not ask you for your password when you use sudo.
- after Linux returns the bash shell prompt $ type sudo su -
Since you already have root privileges, it will not ask you for the root password
- Linux will reply with something like [root@mislab01x root]#
Linux accepts your login as root and gives you the root path.
- You can now enter any commands which require root privileges, without using sudo in front of the commands.
This page is maintained by Al
Bento who can be reached at email@example.com
This page was last updated on February 3, 2003. Although we will attempt
to keep this information accurate, we can not guarantee the accuracy of
the information provided.