Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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.