I am the only user of my Linux Mint system and I noticed that the password I chose to login is the same that got assigned to sudo
.
So my question is: Will changing my login password also change the sudo
password?
If not, how can I change the sudo
password?
Best Answer
By default,
sudo
asks for the user password. Thus, changing the user password (which is also used for login), will also affect sudo invocations.However, you can set in the
/etc/sudoers
for your user therootpw
flag, in which case it would ask for the root password instead.The relevant excerpt from the sudoers(5) man page is:
Similarly, the keyword for not requesting a password for sudo is NOPASSWD.
If you want to set the root password, you can use
sudo passwd
Note that when changing sudo permissions, it is recommended to keep a root console open (eg.
sudo -s
) until it is verified in a different terminal that it indeed works, and you haven't locked out yourself.