After installing PiNet on my Ubuntu machine, I noticed that sudo
is no longer prompting me for a password. This is still the case after rebooting or after running sudo -k
:
$ whoami
thang
$ sudo whoami
root
$ sudo -k
$ sudo whoami
root
As you can see above, no password prompt was printed. The thang
user is not UID 1:
$ grep thang /etc/passwd
thang:x:1000:1000:thang,,,:/home/thang:/bin/bash
And there doesn't seem to be anything strange in my /etc/sudoers
file:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
There is also a file called 01staff
in /etc/sudoers.d
:
$ cat /etc/sudoers.d/01staff
%teacher ALL=NOPASSWD: ALL
In case it's relevant, the groups that thang
belongs to are:
$ groups thang
thang : thang adm dialout cdrom sudo audio dip video plugdev games users input lpadmin sambashare pupil teacher
Running GUI programs that require root access still prompts me for a password but terminal commands do not. What is going on here?
sudo cat /etc/sudoers
terminal command.