Disable password prompt when running sudo via SSH

Recently I came across a problem. I created a deploy script that would SSH into the server and run a bunch of commands, and some of those commands required sudo, but when running commands as sudo presented a password prompt, which was a problem.

I solved this by updating the sudoers file in ubuntu. If you ever face this problem all you have to do it update the file /etc/sudoers on your server

sudo nano /etc/sudoers

Add this line to the end of the file

ubuntu ALL=(ALL) NOPASSWD: ALL

That’s it! Feel free to comment if you have any questions or suggestions.


Posted

in

by

Tags:

Comments

Leave a Reply

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