Remote port forwarding
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?
@samto Update: The remote server auth.log is :
Jan 26 08:50:00 sshd: Accepted publickey for XXXX from XXX.XXX.XXX.XXX port XXXXX ssh2: RSA SHA256: xxxxxxxxx Jan 26 08:50:00 sshd: 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: New session 107 of user XXXX. Jan 26 08:50:01 sshd: Received disconnect from XXX.XXX.XXX.XXX port XXXXX:11: disconnected by user Jan 26 08:50:01 sshd: Disconnected from user XXXX XXX.XXX.XXX.XXX port XXXXX Jan 26 08:50:01 sshd: pam_unix(sshd:session): session closed for user XXXX Jan 26 08:50:01 systemd-logind: Session 107 logged out. Waiting for processes to exit. Jan 26 08:50:01 systemd-logind: 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 -Rworks fine