DEV Community

Discussion on: Running sudo command without password (Mac OS)

Collapse
 
maniflames profile image
Maniflames

The reason why you need to type sudo is to get permission for the action you'd like to take. If every piece of code could do anything it wanted all the time it would be very easy to hack you.

I looked around for a bit and you could configure your script as command that your specific user can run without a password. (stackoverflow)

However I'd suggest just starting it using sudo ./your-script-name so you can provide your password once up front so your whole script can run without asking for premission again for that specific command in your script.