Results 1 to 3 of 3
Linux newbie needs to know how he can securely pass a password to a shell script (so the password doesn't have to show in the clear in the script)? This ...
- 08-03-2009 #1Just Joined!
- Join Date
- Jun 2009
- Posts
- 11
Secure Password to Shell Script
Linux newbie needs to know how he can securely pass a password to a shell script (so the password doesn't have to show in the clear in the script)? This is a script which will run as a cron job.
- 08-03-2009 #2
Well, you cannot pass it in on the commandline, obviously.
One possibility might be to put your password into a file and have the script read that file. By making the owner of the password file the same user as the person running the script and giving the password file permissions 400, only that user will be able to read the file.
Of course, my immediate question is then to ask why you need this password? What are you doing that requires a password?DISTRO=Arch
Registered Linux User #388732
- 08-03-2009 #3Just Joined!
- Join Date
- Jun 2009
- Posts
- 11
Creating a dump.sh script to daily (nightly) dump two databases via mysqldump.


Reply With Quote