Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 866.1k
  • 205
  • 1.8k
  • 2.3k
Source Link
pradeepchhetri
  • 10.2k
  • 13
  • 54
  • 61

Shell Script for logging into a ssh server

I tried writing a shell script which can do automatic login into a ssh server using password which is mentioned in the script. I have written the following code:

set timeout 30
/usr/bin/ssh -p 8484 [email protected]
expect 
{
   "[email protected]'s password" 
   {
      send "password\r" 
   }
}

This code is not running properly, still it is asking for the password. Can somebody please help me in solving this