1

I'm using localhost.run to open tunnels, so I want to launch

ssh -R 80:localhost:8080 ssh.localhost.run

The only problem is that I launch it via LSF as part of a bash script.

I get the error

Pseudo-terminal will not be allocated because stdin is not a terminal.

that I solve by using the option

-T      Disable pseudo-tty allocation.

My current command is

ssh -T -R 80:localhost:8080 ssh.localhost.run

and it is the last command of my bash script. I have also tried using -tt with the same result (https://stackoverflow.com/a/7122115/5133167)

When I launch my script from my tty, I get the expected output (a message like Connect to http://user.localhost.run or https://user.localhost.run)

When I launch it through LSF (using bsub), I don't get any output from SSH (but get the output from the other commands).

I have also tried redirecting the output of ssh to a file: it works fine when launched from the command line but not when launched from LSF.

Labo
  • 2,482
  • 2
  • 18
  • 38
  • 1
    A couple of ideas. If ssh is just forwarding a port and not running a command. Do you need a -N? Also, put a -v on the ssh command line. It could give some clues. Lastly. I don’t understand a few parts of the question. When you say localhost, do you really mean that your connecting to the localhost? And port forwarding to the localhost as well? The other part that is confusing me is the expected output. That must be from the command that the ssh daemon is starting right? (Which must not be literally running on localhost right?) – Michael Closson Dec 27 '19 at 18:52
  • Try telling bsub to save your ssh stdout and stderr in a file, like `bsub -oo ~/ssh.%J.out`, maybe ssh is generating some output that is being dropped. – qneill Jan 30 '20 at 18:04
  • Thanks, I tried bpeek without success. – Labo Jan 31 '20 at 19:38

0 Answers0