Quote:
Originally Posted by
mohtashims
I thought I could save the username and password in a file which could be provided to sudo command. Will that work ?
To repeat:
Quote:
Originally Posted by
Corona688
su, sudo, and other login systems are designed to prevent being scripted.
This is a security measure, because stored plaintext passwords are an extremely bad idea.
They insist on talking to a human, and the way to do that is to insist on talking to a terminal. Not pipes, not files, just terminals.
You can fake a terminal with the
expect language if you absolutely must, but this is a last resort.
Setting nopasswd in sudoers is a better idea. Even better if you can restrict it to one exact thing.
sudoers is sudo's config file, which you edit with the
visudo command.