Take the 2-minute tour ×
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@34.34.34.10 "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)

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 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
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

 
discard

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.