Is it possible to use OpenSSH to relay to other SSH enabled devices such as routers switches etc.. If is this something that can be done without creating a bespoke application on Linux to do it?
Thanks
|
feedback
|
|
Sure; just use SSH port forwarding/tunneling. Start an ssh connection to the "proxy" machine using the following command: ssh -L$LOCALPORT:$REMOTEHOST:$SSHPORT $PROXYHOST $PROXYHOST: the machine you've got SSH access to Leave that connection up to keep the tunnel working. You might want to also add -N to the command so that this connection won't bring up a remote shell and you won't accidentally close it later. Once the tunnel is established, do the following: ssh -p $LOCALPORT localhost This attempts an SSH connection to your local machine on the port that's forwarded to the $REMOTEHOST's SSH port. | |||
|
feedback
|
|
If you are willing to update the configuration on your client you can setup your client to use your gateway box as a proxy. Your relay box will need netcat installed, and for the best results you'll want to have key-based authentication setup. Here is what I use in my .ssh/config to connect through another host.
With the above you can simply run the command ssh internal-ssh-host-proxy from your client machine. | |||||||||||
feedback
|
|
You can forward connections automatically using OpenSSH. In your
What you will end up seeing is two prompts for | |||||
feedback
|