Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using this kind of commands :

ssh -i etc/ssh/vagrant vagrant@ "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?


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

name = raw_input('Give me your name: ')
print("Hello "+name)

We decide to launch it with ssh:

$ ssh python

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)

share|improve this question
Are you sure that the problem is not in the missing tty? I could not reproduce this. – Thomas Berger Oct 12 '12 at 8:05

1 Answer 1

According to we need to use the -t option.

$ ssh -t python
share|improve this answer
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." – Kenny Rasschaert Oct 12 '12 at 13:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.