Prerequisites for using Linux sudo credentials
-
Provide one of the following:
-
Username and password
-
Username and SSH key file path (in PEM format)
-
-
Give the sudo users write access to the
/var/tmpdirectory. -
For sudo users, add the user to the /etc/sudoers file. The following shows the privileges and specifications for users.
-
User:
<Sudo_user>(the actual name of the user account)Privilege:
ALLSpecification:
ALL
-
-
Edit the entry in the
/etc/sudoersfile so the system asks for the sudo user password instead of root user password when you run the sudo command. -
The following shows the privileges to comment or remove from
/etc/sudoers.-
User:
ALLPrivilege:
ALLSpecification:
ALL
NOTE:Only use this option with
Defaultstargetpwon all systems. -
-
When using SSH keys for login credentials combined with sudo, edit the entry in the
/etc/sudoersfile so that the system does not ask for the user password as follows:-
User:
sudo_userPrivilege:
ALLSpecification:
NOPASSWD:ALL
-