Sudoers File To Allow Certain Users Use Command Without Password
Steps To Edit Sudoers File:
- Login Linux server as root.
- Create new group. Example king .
- Create new user and directly add it into just created group. Example kong . Make sure to assign it a password.
- Edit sudoers file.
- At the end of the line, put the line given below and save it. Example we use here is command to list users. Please note that % put in front of means we make it for group but if there is no %, means we make it for single user.
- Test the sudo command. It will execute without password needed.
- To block certain commands, can use !. Example, !cat /etc/passwd.
- To make sure user allowed to use certain commands only. farid ALL = NOPASSWD : /bin/passwd mamat .
- To make sure group allowed to use certain commands only. %faridah ALL = NOPASSWD : /bin/passwd mamat .


Comments