Hãy thử sudo --list
hiển thị cho chúng tôi cấu hình sudo hoạt động cho tài khoản của bạn:
skath@beast:~$ sudo --list
Matching Defaults entries for skath on beast:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User skath may run the following commands on beast:
(ALL : ALL) ALL
skath@beast:~$
Kiểm tra dấu thời gian trên thông tin đăng nhập được lưu trong bộ nhớ cache, điều này có thể giúp biết được lý do tại sao bạn không được nhắc:
skath@beast:~$ sudo ls -al /var/lib/sudo/$USER/
total 20
drwx------ 2 root skath 4096 Jan 28 14:27 .
drwx------ 3 root root 4096 Jan 28 13:52 ..
-rw------- 1 root skath 40 Feb 5 16:18 1
-rw------- 1 root skath 40 Jan 28 14:51 2
-rw------- 1 root skath 40 Jan 28 13:56 tty1
skath@beast:~$
Sử dụng sudo --remove-timestamp
để cố gắng xóa bất kỳ thông tin lưu trữ.
Từ man sudo
:
-K, --remove-timestamp
Similar to the -k option, except that it removes the
user's cached credentials entirely and may not be used
in conjunction with a command or other option. This
option does not require a password. Not all security
policies support credential caching.
-k, --reset-timestamp
When used without a command, invalidates the user's
cached credentials. In other words, the next time sudo
is run a password will be required. This option does
not require a password and was added to allow a user to
revoke sudo permissions from a .logout file.
When used in conjunction with a command or an option
that may require a password, this option will cause sudo
to ignore the user's cached credentials. As a result,
sudo will prompt for a password (if one is required by
the security policy) and will not update the user's
cached credentials.
Not all security policies support credential caching.