/ Published in: Bash
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
You want to make use of the ProxyCommand option of ssh. Here is an example that uses one machine to connect to another.
You can add the following to your ~/.ssh/config file.
Host viatunnel
IdentityFile ~/.ssh/inside_server_rsa
ProxyCommand ssh -i ~/.ssh/proxy_server_rsa user@gateway.mynetwork "nc inside.mynetwork 22"
user myself
This will connect first to user@gatwway.mynetwork and use that to make a connection to myself@inside.mynetwork
Now typing: ssh viatunnel will connect using this configuration.
The ProxyCommand line basically runs 'nc' on the first hop of your connection and establishes a tunnel to port 22 on the second server. Then the outside ssh uses that to connect.
See ProxyCommand here at the openssh manual
Comments
 Subscribe to comments
                    Subscribe to comments
                
                