It may be useful to run the sudo command without password, maybe you’re lazy, maybe your account has no password, or ssh password authentication are not permitted.
Passwordless login
⚠ Here may be dragons!
⚠ While playing with the sudoers system, a small error MAY lock you outside of your system. This can prevent remote AND local logins. Always keep a tty connected logged in as root. ⚠
- Create the file
/etc/sudoers.d/50-sudonopass-group-passwordless# Users in the 'sudonopass' group don't need passwords %sudonopass ALL=(ALL) NOPASSWD:ALL - Ensure correct permissions
sudo chmod 0440 /etc/sudoers.d/50-sudonopass-group-passwordless - Check configuration
sudo visudo -c - Create the group
sudonopass, if you know what a GID is, select a free one and, do that:sudo groupadd -g FREE_GID sudonopass # or if you don't : sudo groupadd sudonopass - Add the user to the group
sudonopasssudo usermod -a -G sudonopass the_user
~~~
Question, remark, bug? Don't hesitate to contact me or report a bug.