
I have a computer at home with SSH installed which I would like to be able to control remotely. However, I am not able to allow SSH port forwarding through my router, so the only way to get in would be to have the installation on my computer listen to a port on a server for connections. Is there any existing software for this purpose?
Antwort1
As you mention having access to an outside server, you should be able to do this via reverse tunnel.
From your home system, you'll want to ssh to the remote server, with syntax like:
ssh -g -R 12345:localhost:22 user@remoteserver
- the -g flag allows remote hosts to connect to the forwarded port. Otherwise, the default ssh setting is that only the system that first made the tunnel could use the port (meaning the home server)
- -R is used to set up the reverse tunnel, and we're saying that connections to remoteserver:12345 should be forwarded to localhost:22
To use the tunnel, you'd do something like:
ssh -p 12345 remoteserver
Of course, for this tunnel to work, you'll need to ensure that the ssh session from homeserver to remoteserver stays alive.
Antwort2
@Ashley Steel, versuchen Sie, den Wert von ServerAliveInterval auf einen Wert ungleich Null zu setzen. Auf der SSH-Befehlszeile würde das etwa so aussehen: -oServerAliveInterval\ 60
Sie können es auch in der Datei .ssh/config des Remote-Hosts konfigurieren.