M
M
Mike Diam2016-04-03 19:20:36
SSH
Mike Diam, 2016-04-03 19:20:36

How to remove the password prompt after sudo su?

After connecting with the admin user via ssh and entering the command sudo su or sudo -i, does the server keep asking for a password?
/etc/sudoers tried to change, but the password still asks.
File contents:

admin   ALL=NOPASSWD: ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD: ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) NOPASSWD: ALL

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2016-04-03
@mikediam

you have
admin ALL=NOPASSWD: ALL
is read first, and therefore for this user the other two lines will no longer work.
If admin is in the admin or sudo group, then just remove the line from admin.
If not included, write
admin ALL=(ALL) NOPASSWD:ALL

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question