Is it possible to write a script that run
sudo command without typing password?. I googled and its said that
su doesn't read password from buffer. So is there any solution?
Two approaches as far as I can tell:
When setting up
sudo for a specific user or group, you can use the
ALL=NOPASSWD option in the
Some pointers on how to do that:
You can use
sudo with the
-S option to give the password through standard input instead of the terminal device. For example, you can write down the password in a file, and then do
cat myPass.txt | sudo -S your_command.