SUDO Installation:
Download the sudo source from : ftp://ftp.sudo.ws/pub/sudo/
- gunzip sudo*
- tar xvf sudo*
- cd sudo-version
- ./configure
- make
- make install
•
- Control file - /etc/sudoers – should not be edited manually.
- Command to edit sudoers file /usr/local/sbin/visudo
- Entries “user hostlist = (userlist) commandlist”
- Sample Entries :
- All users to do dialup ALL ALL=/dialup,/hangup
- sara user alone to execute all root commands sara ALL=(root)
- ALL Default setting will have sudo command with password If we need to disable sudo without password ALL NOPASSWD:ALL=/dialup,/hangup Restricting commands: %users ALL = ALL, !SU, !SHELLS
Using SUDO:
•
- If the SUDO is enable with password first time it will ask for password which is the users password, for next 5 mins it will not ask again.
- Eg:
- $ whoami sara
- $ sudo whoami root