read user password from a file in linux during ssh
Please look @ below script :
--- [root@rptsvr ~]# cat test.sh #!/bin/sh echo "Enter the ip: " read ip echo "Please type user name :" read username ssh $username@$ip << ! --- Here In this script I want to use a text file (for example , pass.txt) to take the password during password prompt .And login to the specified server . The pass.txt file contains the password serially , like ------------- cat pass.txt oracle Oracle linux ------------- Is it possible to do ? |
This is ill-advised: instead use pubkey auth as per the SSH best practices. Also please explain what you need those logins for because there may be different, safer ways to accomplish certain tasks.
|
All times are GMT -5. The time now is 09:52 PM. |