Ubuntu – Want to execute sudo command on shell startup

bashrcsudo

I've put a command sudo do something in my ~/.bashrc, this works but everytime I open the terminal I have to type in my password. How do I make it so there is no password-typing?

Best Answer

You can use the NOPASSWD attribute in the sudoers file to tell sudo not to require a password. A line like the follows in the sudoers file should let you run that command without a password:

yourlogin ALL=(ALL) NOPASSWD: command_here

To edit the sudoers file, run the command sudo visudo.