I enjoy using Linux because I am a tinkerer by nature, however the extra security that comes with it can be rather cumbersome at times, especially when running scripts.
One of the peeve I have is being asked for admin password whenever I make changes or run custom scripts, and I do a lot of both.
Before proceeding, this is the only warning I will give you:
This is a dangerous practice as you may inadvertently delete or change system files. After all, this is one of the features that makes Linux safer. I have done it. Let me tell you it’s no fun reinstalling from scratch. One thing I have learned from making this mistake is to make backups of all your important stuff and the best way to approach this is to ask yourself: “If I lost my Linux computer today, what would I miss the most?” Back that shit up!
Well, that goes with any computer system actually.
Remember this quote: “Jesus saves but everyone else has to do backups.“
So, now that you have been warned, here is how to create a Linux user without being asked for a Sudo password. We simply need to edit one file, it is located here: /etc/sudoers. Before you get carried away and open it with your preferred text editor, there is a special tool to do this, it’s called ‘visudo‘, so you just type:
After you enter your Sudo password for the last time, all you need to do is scroll to the end of the file and enter the following text:
# Uncomment to allow members of group sudo to not need a password
%sudo ALL=NOPASSWD: ALL
Again, this may not be the most safe or secure way of doing things, but if you are OK with the risks, all you have to do is reboot and voilà! No more password to enter when running scheduled software updates scripts!