How to do an ssh -t admin@ipaddress command with paramiko?
Asked by
Hachem
Hi,
I am trying to do an ssh -t admin@ipaddress command with paramiko
so i saw that in the channel class, there is the get_pty() method that replace the -t
and i use this piece of code:
import socket,paramiko
sock = socket.
sock.settimeout(20)
sock.connect(
_t = paramiko.
_t.connect(
_chan = _t.open_session()
_chan.get_pty()
_chan.exec_
when i execute the script nothing happen, in the /var/log/messages of the server i can see that the session was opened for
user root.
Any help.
Thanks in advance.
Best Regards,
Hachem
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- paramiko Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Lars Friedrichs
- Solved:
- Last query:
- Last reply:
To post a message you must log in.