3

I am using this kind of commands :

ssh -i etc/ssh/vagrant [email protected] "cd floss_project; make install"

But if during the installation script, a user prompt is needed, I cannot see what is the question asked since, the CLI is not flush into the SSH before a \n.

How can I ask SSH to auto flush the prompt before the \n so I can see which answer I should give?

Edit:

To Help you to reproduce this bug, let say we have the following script:

name.py

#!/usr/bin/python
name = raw_input('Give me your name: ')
print("Hello "+name)

We decide to launch it with ssh:

$ ssh 127.0.0.1 python name.py

The curser is waiting for our input without actually asking for the wanted Give me your name:

How can I force SSH to display this information (actually to flush the STDOUT before a STDIN)

1
  • Are you sure that the problem is not in the missing tty? I could not reproduce this. Oct 12, 2012 at 8:05

1 Answer 1

6

According to http://www.derkeiler.com/Newsgroups/comp.security.ssh/2005-03/0056.html we need to use the -t option.

$ ssh -t 127.0.0.1 python name.py
1
  • Complementing this answer with an excerpt from the man page: "-t Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty." Oct 12, 2012 at 13:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .