The following code is working fine to get output of command execution on remote server for IPv4 using paramiko.SSHClient
. But the same code is not working for IPv6 server.
import paramiko
dssh = paramiko.SSHClient()
dssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
dssh.connect("IPv6_Address", username="root", password="orange")
stdin,stdout,stderr=dssh.exec_command("pwd")
print(stdout.read())
and then I tried to use socket connection for IPv6 like below
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
sock.connect((hostname, port))
t = paramiko.Transport(sock)
but paramiko.Transport
has no exec_command
.