sudo without a password

Note, this is not something I recommend doing. In fact, the only reason why I’m documenting it is that I am removing this solution from the last box I used to have it on.

Anyway, edit the /etc/sudoers file (with visudo, as root), then add lines under the default one for root, like this:

# User privilege specification
root	ALL=(ALL) ALL
bolt    ALL=(ALL) ALL

(replace “bolt” with your own username)

If you would rather want to not type a password only for specific commands, specify them like this:

bolt	ALL=NOPASSWD: /sbin/shutdown, /bin/mount, /bin/umount

(replacing the username and commands with the ones you want)

Leave a Reply

Your email address will not be published. Required fields are marked *