Hackernoon logoConfigure Your Linux With Passwordless Sudo For A Specific User by@itsvinayak

Configure Your Linux With Passwordless Sudo For A Specific User

image
vinayak Hacker Noon profile picture

@itsvinayakvinayak

Computer Science and Engineering student

Linux follows tough rules when it comes to permission. Being a root user or sudo user gives you permission to do almost anything which normal user don’t have. Several commands need sudo keyword to run and each time you try to run sudo, Linux asks for a password, today we will configure a passwordless sudo.

Step 1: We need to edit the sudoers file we can use command.

$ sudo gedit /etc/sudoers

this will open a document

image

Step 2: Edit “ALL=(ALL) NOPASSWD: ALL” with username below the line includedir /etc/sudoers.d

>> username ALL=(ALL) NOPASSWD:ALL

here, the username is your username for which you want to configure passwordless sudo

Step 3: get the current username , use command

$ echo "$USER"
image

Step 4: Edit file with username and save it

image

Step 5: Try using sudo command

$ sudo apt update
image

and done, now you can use sudo without any password

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.