SSH remote port fowards

Talz

Cadet
Joined
Apr 25, 2016
Messages
8
Goal is to listen on my FreeNAS box to 5999 for a "remote" port forward from a client and tunnel it back to said client. When I connect from the client with:
ssh -v -R 5999:localhost:5900 (other auth stuff)
... I can see various message about it succeeding
debug1: Remote connections from LOCALHOST:5999 forwarded to local address localh ost:5900 debug1: Remote: Forwarding listen address "localhost" overridden by server Gatew ayPorts debug1: remote forward success for: listen 5999, connect localhost:5900 debug1: All remote forwarding requests processed
However if I check on FreeNAS...
netstat -a | grep 5999 netstat -a | grep LISTEN
I don't see my port listed. Also (of course) my forward is not working.

I have the "Allow TCP port forwarding" box checked and tried adding "GatewayPorts yes" under extra options. Also of note is that all sorts of "local" forwards work fine. (Poor man's VPN I have setup here.)
Ideas?
 

rvassar

Guru
Joined
May 2, 2018
Messages
972
No luck. I'm not really sure what else to try.

Have you checked to see if port forwarding is enabled in /etc/ssh/sshd_config on the NAS? My 11.2 has all those statements commented out, ala:

#AllowTcpForwarding yes
#PermitTunnel no

I'd have to go do some reading to figure out what & how these two option differ...
 

Talz

Cadet
Joined
Apr 25, 2016
Messages
8
Have you checked to see if port forwarding is enabled in /etc/ssh/sshd_config on the NAS? My 11.2 has all those statements commented out, ala:

#AllowTcpForwarding yes
#PermitTunnel no

It seems everything in that file is commented out. Also including things I know are currently in effect (non-standard port, ect). I'm guessing this is one of those files that the database setup overwrites on startup.
 

rvassar

Guru
Joined
May 2, 2018
Messages
972
It seems everything in that file is commented out. Also including things I know are currently in effect (non-standard port, ect). I'm guessing this is one of those files that the database setup overwrites on startup.

Have you tried adding the tunnel statement to the local client config file? Ala:

Code:
Host host.domain.tld
  Protocol 2
  Port 27022
  LocalForward 5999 localhost:5900
  Ciphers aes256-ctr,aes192-ctr
  Compression yes
  MACs hmac-sha2-512,hmac-sha2-256
  User Talz
  IdentityFile ~/.ssh/id_rsa
 

Talz

Cadet
Joined
Apr 25, 2016
Messages
8
Had to tinker around with that one. No change. I see in the client debug that it's claiming to have opened the port, but nothing is listening on FreeNAS.
 
Top