import paramiko
host = "172.21.14.48"
port = 22
username = "user"
password = "xxx*9841"
command = "ls"
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(host, port, username, password )
stdin, stdout, stderr = ssh.exec_command(command)
lines = stdout.readlines()
print(lines)
This Code works SSH successful. But i need to ssh to cp@172.21.14.48 with same username and password. I tried below code but getting error.
host = "cp@172.21.14.48"
Error message as: ile "C:\Program Files\Python38\lib\socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11003] getaddrinfo failed
Any suggestion..? However with putty i can ssh to cp@172.21.14.48.