Monday, 30 January 2012

Access the server through ssh login using bash script

1. Install expect using yum
$ yum install expect

2. create a blank file and copy the below line
$ vi

expect -c "
spawn ssh username@IP -p portnumber
expect password
send $password\r
3. execute the script
$ sh

No comments:

Post a Comment