Main Menu

Search

LINUX: How To Add User to Sudoers With NOPASSWD Without Editing /etc/sudoers File?

 
Below is the command for adding the current user you are logged in as to sudoers with nopasswd setting (not to prompt for password) without updating /etc/sudoers file.

echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER

Above command adds current user to sudoers. For adding any other specific user for e.g. appuser to sudoers you can run below command as root user.

echo "appuser ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/appuser


Key Words:
 
sudo access sudoers user users password without passwd authentication authenticated prompt


No comments:

Post a Comment