Fedora: how to add a sudo user (no password)

To avoid this needing to type password for sudo, you can edit /etc/sudoers and add this command at the end of the file:

$ sudo visudo

Note if you want to change the default editor use

$ sudo update-alternatives --config editor

Use the safe command sudo visudo to edit and check the syntax of the edits, otherwise if you directly edit and make a mistake you computer might not work.


Save and exit. Finally, you will also need to create the admin group:

groupadd admin

and again, you need to be part of the admin group. So type this command in a shell:

# usermod -a -G admin <your username>

You should be able to use sudo without password.

To increase timeout for sudo

Defaults timestamp_timeout=1800   # increase the sudo timeout