Long time i am searching for this, i would like to know is it possible to pass passwords in a shell script? Many of the answers returned with no. Recently i read an article stating that how to pass passwords in a shell script. I have tried that, but it doesn't seem to work. This is the link. Can anyone checkitout and revert back? Also pls say me is there a way to pass passwords in a shell script? If no pls say me how linux gets the input for the password?
|
By "entering passwords", you likely mean entering data without being visible for the user. (suggested by geirha) When using bash, you can use the
Alternatively, change the behavior of the terminal to hide typed characters with
Note: the
References: |
|||||||||
|
|
To which program do you want to pass a password? The script on the link works for me. Note that is not a shell script but an expect script (needs the package Non-interactive Some other programs (like Providing a password as a command line option is often a security problem as on most systems any user can see any other users processes including there command line arguments using simple tools like |
|||||
|
|
A script should never really handle passwords. Have whichever application needs the password ask for it itself, or if that's not possible, find a better means of authenticating with the application. Please read http://mywiki.wooledge.org/BashFAQ/069 |
|||
|
|
|
|
|||
|
|
