Ubuntu stop sudo password prompt

If you are working on a script that needs to be run as sudo we need to add out permissions to our current user ( or whoever will be running the script )

If you do not know your current user, you can run the following command to see who you are currently logged in as

$ whoami

Now that we have that, it should echo out your current user. save this for the next stop. In this example we will pretend our username is “jon”

$ sudo visudo

At the bottom of that file, we need to add the following line ( make sure to change the first word “jon” and swap it out for your current user )


Now that we have all of that in place. We should now be able to run sudo while logged in as that user to run commands without being prompted for the sudo password.


Innovative, entrepreneurial and positively unsatisfied mind that constantly pushes the tech boundaries to create new solutions and devices that change people’s lives. Throughout my career, I have had the opportunity of having a multi-disciplinary experience, which led me to wear the hats of: Architect, IoT Consultant (Internet of Things Consultant), Developer, Designer, Engineer, Server Admin, Consultant and Project Manager – to name a few. Based on this diversified background, I get projects done by following smart ideas and well-planned goals. In a world which is getting more unconventional by the day, I use unconventional ways, and a very healthy dose of integrity, to create devices and solutions that help companies go from a steady present to a dynamic future.

You may also like...