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