hello,
i'm trying to connect to my vps with pythonista, but it doesn't seem to work.
When i run this, it just freezes after i enter the credentials.
No errors, nothing.
Any help would be greatly appreciated.
Thank you
import paramiko
import sys
# ask for vps ip and current root password
print 'vps ip:'
vps_ip = raw_input()
print 'current root password:'
current_root_password = raw_input()
# paramiko connect
ssh = paramiko.SSHClient()
try:
ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=vps_ip, username='root', password=current_root_password)
except:
print 'error: '
print sys.exc_info()
# execute remote command
stdin, stdout, stderr = ssh.exec_command('uptime')
stdin.close()
for line in stdout.read().splitlines():
print line
stdout.close()
stderr.close()
ssh.close()