3

How to enable passwordless sudo in Linux

 2 years ago
source link: https://dev.to/danielcristho/how-passwordless-sudo-in-linux-14c0
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Daniel Pepuho

Posted on Nov 14

How to enable passwordless sudo in Linux

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 demo
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
Enter fullscreen modeExit fullscreen mode

2.after that type:

$ sudo visudo
Enter fullscreen modeExit fullscreen mode

3.go down to the bottom, then add this to assign a new user become sudo:

demo ALL=(ALL:ALL) ALL
Enter fullscreen modeExit fullscreen mode

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

Enter fullscreen modeExit fullscreen mode

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK