Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I'm a newbie linux (Ubuntu) user and i have a question to sudo su, I always like use the root in the shell for no annoying privilgies errors :)

But the problem is sudo su always ask me for a password and this is also annoying to me, because i'm on studying about linux so i open alots of shells and close them in short time :D

For that i tried write this little bash script :

#!/bin/bash
echo "My_Password" | sudo su

And make a symbolic link to it for executing it each time i open a shell, this is less annoying, because sudo always ask me for the password and sometimes i do some mistake in it :)

But the problem is the bash script doesn't work :( Does anyone know how to this??, or setting my password in sudo config file and it doesn't ask me anymore for the password?? :)

Thank you all

share|improve this question

marked as duplicate by Radu Rădeanu, Seth, Warren Hill, psusi, guntbert Oct 4 '13 at 19:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 1 down vote accepted

You can edit your sudoers file, probably with a sudo visudo and add the line
$USER ALL=(ALL) NOPASSWD: ALL
where $USER is your own username

By the way, sudoers is in /etc/sudoers but it is dangerous to edit that file directly and possibly impossible unless you are root. It is better to use visudo since it writes to a temp file and then if everything went ok it will overwrite after it is finished writing. If vi is tricky, I suggest being VERY careful =D

share|improve this answer
    
It works :), Thank you so much ^__^. –  La VloZ Oct 3 '13 at 20:38
    
glad I could help –  Jacob Minshall Oct 4 '13 at 0:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.