1

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

La VloZ
  • 13

1 Answers1

1

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

guntbert
  • 13,134