3

I want to write a script that will get me straight to a python shell on another box so that i don't have to first run ssh and second run python.

When I do "ssh hostname python" it just hangs - it's something to do with the fact that python is interactive. "ssh hostname cat x" works fine.

Is there some ssh option that will make this work?

3 Answers 3

10
ssh -t user@host python

The -t flag forces ssh to allocate a pseudo-terminal to the connection. Normally it won't do this if a command is given on the ssh command line, which results in python running in a non-interactive mode.

Sign up to request clarification or add additional context in comments.

Comments

4

actually figured it out, i needed to do ssh -t hostname python

Comments

4

You need the -t option to force the allocation of a pseudo-tty

ssh -t host python

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.