Unable to connect to remote host using paramiko?

For me the solution was:

client = SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(AutoAddPolicy())
client.connect(host, username=user,password=password)

Try using this:

ssh.connect('host', username='username',password='password')

You can also add your public key to known hosts in server, if you wish to skip password and connect without giving your password. In that case use:

ssh.connect('host', username='username')

Maybe you are missing the missing_host_key_policy

What about this one:

proxy = None
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(host['hostname'], username=host['user'], sock=proxy)

more examples here: www.programcreek.com