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 ?
|