tags:

views:

560

answers:

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?

+9  A: 
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.

bdonlan
+4  A: 

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

zak23
+4  A: 

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

ssh -t host python
JensenDied