Remote port forwarding
-
Hello,
I am trying to establish access to pfSense GUI via a remote public server (both my desktop and pfSense firewall are in NAT without public IP).
I am able to establish a remote port forwarding from the firewall to the public server and local port forwarding from my desktop to the public server. When setting it up via SSH client, it is working as expected.
The problem is if I run the "ssh -R" command from GUI/Command Prompt or Cron. The output is the same as in the terminal and it looks like the SSH tunnel is established, but it is not.
Do you have any idea, what's wrong?
Thanks
-
@samto Update: The remote server auth.log is :
Jan 26 08:50:00 sshd[9696]: Accepted publickey for XXXX from XXX.XXX.XXX.XXX port XXXXX ssh2: RSA SHA256: xxxxxxxxx Jan 26 08:50:00 sshd[9696]: pam_unix(sshd:session): session opened for user XXXX by (uid=0) Jan 26 08:50:00 systemd: pam_unix(systemd-user:session): session opened for user XXXX by (uid=0) Jan 26 08:50:01 systemd-logind[458]: New session 107 of user XXXX. Jan 26 08:50:01 sshd[9794]: Received disconnect from XXX.XXX.XXX.XXX port XXXXX:11: disconnected by user Jan 26 08:50:01 sshd[9794]: Disconnected from user XXXX XXX.XXX.XXX.XXX port XXXXX Jan 26 08:50:01 sshd[9696]: pam_unix(sshd:session): session closed for user XXXX Jan 26 08:50:01 systemd-logind[458]: Session 107 logged out. Waiting for processes to exit. Jan 26 08:50:01 systemd-logind[458]: Removed session 107.
So it seems that the connection was successfully set up, but right after that it was disconnected.
Do you have any idea, how to keep it running?
-
@samto I found a root cause of the problem. It is well described here: https://www.everythingcli.org/ssh-tunnelling-for-fun-and-profit-tunnel-options/
So, the combination
ssh -f -T -N -R
works fine