http://www.perlmonks.org?node_id=818429


in reply to Change linux root passwor

Just one more advice beyond marto's response: you should not pass the password to your script as a command line argument because it will appear in the output of ps (and in the /proc file system) and other users of the system can read it. Write it to the script and apply chmod 700 on it, or better read it from the standard input.