2

Can anyone suggest how I can avoid this situation? It never asks for password but still complains the password is wrong.

sudo su -
Sorry, try again.
Sorry, try again.
sudo: 3 incorrect password attempts

sudoers file entry :

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

Thank you.

Zanna
  • 72,312
ravi
  • 21

2 Answers2

0

In order to have sudo not asking a password you'd use ALL=(ALL) NOPASSWD: ALL attached to the user or to the group of your choice in the configuration file.

I'd suggest you to see man sudoers or a tutorial like this.

I prefer the man page first, though.

By the way, in order to get a root shell you can also run sudo -s -H. Again, the man page can be of help.

EnzoR
  • 1,747
0
  1. Ensure that your current user (say jdoe) is in the sudo group. To check this, run as jdoe:
groups

If not, add jdoe to this group (using the root profile or any sudoer profile) as explained in AU: How do I add a user to the "sudo" group?.

  1. Do not change /etc/sudoers as evoked (here). The default configuration guarantees that any member of the sudo group is allowed to run sudo. Disabling password using sudo means that any sudoer is roughly the same as being root, with all the security concerns it implies.

  2. When using sudo as jdoe, you must enter the jdoe's password. Ensure that you type what you believe (you could check in the command line):

  • The keyboard layout is what you think (e.g. qwerty vs azerty);
  • Verr num is enabled if you rely on the numeric keypad;
  • The caps lock are disabled (because under Linux, passwords are case sensitive.