Skip to content Skip to sidebar Skip to footer

How To Do Ssh With -t Option Using Paramiko

I am trying to login to some remote servers and trying to fetch the system info. During that process I have faced an issued in some of the servers, where the password is not really

Solution 1:

You can use the get_pty parameter:

stdin, stdout, stderr = ssh.exec_command("sudo -k udisksctl status", get_pty=True)

There's some side effect though. With get_pty=True, all output will be sent to stdout and so you cannot get data from stderr any more.

Post a Comment for "How To Do Ssh With -t Option Using Paramiko"