without using the complex ssh key pair exchange and all...!
Make sure you have the expect package installed in your machine...
lets try for telnet login...
make a file by name telnetme
$vi telnetme
#!/usr/bin/expect
eval spawn telnet 10.0.0.27
set timeout 30
expect login:
send "
expect password:
send "
interact
Now set execute permission to the script and copy it to any of the directories in your PATH variable
For SSH Login theres a little change...
I am here making a file by nane sshme
$vi sshme
#!/usr/bin/expect
eval spawn ssh 10.0.0.27
set timeout 30
expect password:
send "
interact
NOTE: change the italicised strings with appropriate username and password
It is recommended that you give read permission only to the user who is using this script , otherwise all users could read the plain password entered
PS: Please extend the features of expect if someone knows it...
1 comment:
Sir,inspired by ur blog i have also started a blog at http://shyjug.blogspot.com .
please suggest corrections....
Shyju G (i met u wen i came for my RHCE Exam at nascent...hope u remember ;) )
Post a Comment