Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I currently have a process where i login to a machine, need to ssh to another machine and then run a command for an interactive job (on a queue-ing system). Is there a way to do this all in one shot?

Right now:

ssh my_machine
srun --pty R

I would to do this:

ssh my_machine "srun --pty R"

However this returns some errors:

 stty: standard input: Invalid argument
 srun: error: Not using a pseudo-terminal, disregarding --pty option
share|improve this question

1 Answer 1

up vote 2 down vote accepted

You need to allocate a pseudo-tty to your ssh session for the srun command.

Try this:

ssh -t my_machine "srun --pty r"
share|improve this answer
    
could you explain what a pseudo-tty is please? –  Alex Sep 16 '13 at 19:26
    
tty is an abbreviation for terminal. Back in the day a terminal was essentially a monitor with a keyboard that interacted with a server through a serial connection. A pseudo-tty was invented in order to provide the same functionality for workstations that were remotely connected. Essentially any interaction you do with the shell in a modern system is done through a pseudo-tty. Running a remote command through an ssh connection will not, by default, allocate a pseudo-tty so the -t switch is added in order to force it. –  Joel Taylor Sep 16 '13 at 19:36

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.