I can show you many steps to configure passwordless sudo for specific user:
1.open your terminal and type this to add new user:
$ sudo adduser ansible
Adding user `demo' ...
Adding new group `demo' (1004) ...
Adding new user `demo' (1004) with group `demo' ...
Creating home directory `/home/demo' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for demo
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
2.after that type:
$ sudo visudo
3.go down to the bottom, then add this to assign a new user become sudo:
ansible ALL=(ALL) NOPASSWD:ALL
4.done, now you have new user, that will able to execute sudo command without providing a sudo password.
N/B: in Debian you must install sudo:
$ apt install sudo
Top comments (0)