meta2
June 14th, 2016, 08:52 AM
I configured sudoers like this never to require my password.
ubuntu ALL=(ALL:ALL) NOPASSWD:ALL
I'm wondering why sudo requires my password when doing "sudo -v".
For example, "sudo ls /root" or "sudo -s" can gain root privilege without typing my password.
However, in case of "sudo -v" requires password, why? Other Linux distro never require password
such case.
No password required in this case. That's what I expect.
ubuntu@localhost $ sudo ls -lha /root; sudo -k; sudo ls -lha /root;
total 24K
drwx------ 4 root root 4.0K Jun 14 07:15 .
drwxr-xr-x 23 root root 4.0K Jun 14 07:35 ..
-rw-r--r-- 1 root root 3.1K Oct 22 2015 .bashrc
drwxr-xr-x 2 root root 4.0K Jun 14 07:15 .nano
-rw-r--r-- 1 root root 148 Aug 17 2015 .profile
drwx------ 2 root root 4.0K May 20 07:09 .ssh
total 24K
drwx------ 4 root root 4.0K Jun 14 07:15 .
drwxr-xr-x 23 root root 4.0K Jun 14 07:35 ..
-rw-r--r-- 1 root root 3.1K Oct 22 2015 .bashrc
drwxr-xr-x 2 root root 4.0K Jun 14 07:15 .nano
-rw-r--r-- 1 root root 148 Aug 17 2015 .profile
drwx------ 2 root root 4.0K May 20 07:09 .ssh
Oddly, password required twice. In this case, password shouldn't be required.
ubuntu@localhost $ sudo -v; sudo -k; sudo -v
[sudo] password for ubuntu:
[sudo] password for ubuntu:
Debian's behaviour is what I expected.
debian@localhost $ sudo -v; sudo -k; sudo -v
debian@localhost $
Thanks,
ubuntu ALL=(ALL:ALL) NOPASSWD:ALL
I'm wondering why sudo requires my password when doing "sudo -v".
For example, "sudo ls /root" or "sudo -s" can gain root privilege without typing my password.
However, in case of "sudo -v" requires password, why? Other Linux distro never require password
such case.
No password required in this case. That's what I expect.
ubuntu@localhost $ sudo ls -lha /root; sudo -k; sudo ls -lha /root;
total 24K
drwx------ 4 root root 4.0K Jun 14 07:15 .
drwxr-xr-x 23 root root 4.0K Jun 14 07:35 ..
-rw-r--r-- 1 root root 3.1K Oct 22 2015 .bashrc
drwxr-xr-x 2 root root 4.0K Jun 14 07:15 .nano
-rw-r--r-- 1 root root 148 Aug 17 2015 .profile
drwx------ 2 root root 4.0K May 20 07:09 .ssh
total 24K
drwx------ 4 root root 4.0K Jun 14 07:15 .
drwxr-xr-x 23 root root 4.0K Jun 14 07:35 ..
-rw-r--r-- 1 root root 3.1K Oct 22 2015 .bashrc
drwxr-xr-x 2 root root 4.0K Jun 14 07:15 .nano
-rw-r--r-- 1 root root 148 Aug 17 2015 .profile
drwx------ 2 root root 4.0K May 20 07:09 .ssh
Oddly, password required twice. In this case, password shouldn't be required.
ubuntu@localhost $ sudo -v; sudo -k; sudo -v
[sudo] password for ubuntu:
[sudo] password for ubuntu:
Debian's behaviour is what I expected.
debian@localhost $ sudo -v; sudo -k; sudo -v
debian@localhost $
Thanks,