fixunix
Tags Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Warning: remote port forwarding failed for listen port 4043 - SSH

This is a discussion on Warning: remote port forwarding failed for listen port 4043 - SSH ; I have a script that does a port forwarding for me: ssh -n -R localhost:4043:localhost:22 remoteserver.example.com The problem with this is that if port forwarding fails, ssh prints Warning: remote port forwarding failed for listen port 4043 But it STAYS ...


Fix Unix > Technologies & Tools > Protocols > SSH > Warning: remote port forwarding failed for listen port 4043

Reply
 
LinkBack Tools
  #1  
Old 10-09-2007, 05:58 PM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Warning: remote port forwarding failed for listen port 4043

I have a script that does a port forwarding for me:

ssh -n -R localhost:4043:localhost:22 remoteserver.example.com

The problem with this is that if port forwarding fails, ssh prints

Warning: remote port forwarding failed for listen port 4043

But it STAYS CONNECTED instead of properly failing with exit code.

So it is a MAJOR pain to detect this condition and kill ssh.

How can I change is so that, when report port forwarding cannot be
accomplished, ssh exits right away?

I think that it is a bug, period.

thanks

i
Reply With Quote
  #2  
Old 10-10-2007, 05:00 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: Warning: remote port forwarding failed for listen port 4043

>>>>> "Ignoramus3694" == Ignoramus3694 writes:

Ignoramus3694> I have a script that does a port forwarding for me: ssh
Ignoramus3694> -n -R localhost:4043:localhost:22
Ignoramus3694> remoteserver.example.com

Ignoramus3694> The problem with this is that if port forwarding fails,
Ignoramus3694> ssh prints

Ignoramus3694> Warning: remote port forwarding failed for listen port
Ignoramus3694> 4043

Ignoramus3694> But it STAYS CONNECTED instead of properly failing with
Ignoramus3694> exit code.

Ignoramus3694> So it is a MAJOR pain to detect this condition and kill
Ignoramus3694> ssh.

Ignoramus3694> How can I change is so that, when report port
Ignoramus3694> forwarding cannot be accomplished, ssh exits right
Ignoramus3694> away?

Reading the documentation [ssh_config(5)]:

ExitOnForwardFailure
Specifies whether ssh(1) should terminate the connection if it
cannot set up all requested dynamic, tunnel, local, and remote
port forwardings. The argument must be ``yes'' or ``no''. The
default is ``no''.

Ignoramus3694> I think that it is a bug, period.

It is not a bug, since that is how it is documented to work.

Ignoramus3694> thanks

Ignoramus3694> i

--
Richard Silverman
res@qoxp.net

Reply With Quote
Reply

Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to listen on port unix Weblogic 2 10-10-2007 12:21 AM
Re: Port forwarding to listen on designated interface unix openssh 0 10-08-2007 01:37 AM
Port forwarding to listen on designated interface unix openssh 0 10-08-2007 01:37 AM
remote port forwarding with dynamic port on the far end unix openssh 0 10-08-2007 01:31 AM
port forwarding (listen IP, not localhost)? unix SSH 2 10-03-2007 03:10 AM


All times are GMT. The time now is 09:03 PM.