This error came for ssh is lock.so open the terminals and execute that command
xxxx@toad:~$ rm .ssh/known_hosts
remove the known_hosts
another options is you login in windows means check command prompt. if you try to login in windows means use for pexpect
child = pexpect.spawn('ssh tiger@172.16.0.190 -p 8888')
child.logfile = open("/tmp/mylog", "w")
print child.before
child.expect('.*Are you sure you want to continue connecting (yes/no)?')
child.sendline("yes")
child.expect(".*assword:")
child.sendline("tiger\r")
child.expect('Press any key to continue...')
child.send('\r')
child.expect('C:\Users\.*>')
child.sendline('dir')
child.prompt('C:\Users\.*>')
pxssh uses the shell prompt to synchronize output from the remote host.
In order to make this more robust it sets the shell prompt to something more unique than just $ or #. This should work on most Borne/Bash or Csh style shells. Refer http://www.pythonforbeginners.com/code-snippets-source-code/ssh-connection-with-python/