I am writing a SSH command line wrapper but I discovered that doesn't want to run interactively.
Let's say I do have ssh.py which is supposed to establish an interactive ssh session.
If I run:
subprocess.open('ssh -t server')andp.wait(), I will get an error:Pseudo-terminal will not be allocated because stdin is not a terminal.- if I try to force it by using
-t -tit will block.
Note: I really need an interactive session, as I try to use screen to restore a previous connection.
How can I solve this problem?
Note: I do not want to control the called ssh from python in any way.