Skip to main content
added 24 characters in body
Source Link
Michael Mrozek
  • 95.7k
  • 40
  • 245
  • 236

usingUsing SSH there is a clear solution:

  1. on your local machine set up your ~/.ssh/config~/.ssh/config such that it has the following:

    host WhatYouWillCallTheConnection hostname the.gateway.server.address.com user YourUsernameOnTheGateway

     host WhatYouWillCallTheConnection
         hostname the.gateway.server.address.com
         user YourUsernameOnTheGateway
    
  2. On both the gateway and the end server you'd like to connect to, make sure that you have your local client's public keys located in the ~/.ssh/authorized_keys~/.ssh/authorized_keys

  3. On the gateway machine you need to alter the ~/.ssh/authorized_keys~/.ssh/authorized_keys such that at the beginning of the line that specifies your client's public key, add the forced command as follows:

    command="ssh -A [email protected]" ...yourPublicKey....

     command="ssh -A [email protected]" ...yourPublicKey....
    

The -A-A is to forward the agent if you don't like to send passwords all the time...

This way, anytime you do something like ssh WhatYouWillCallTheConnection it will run straight through the gateway and connect you to the server on the other side transparently.

using SSH there is a clear solution:

  1. on your local machine set up your ~/.ssh/config such that it has the following:

    host WhatYouWillCallTheConnection hostname the.gateway.server.address.com user YourUsernameOnTheGateway

  2. On both the gateway and the end server you'd like to connect to, make sure that you have your local client's public keys located in the ~/.ssh/authorized_keys

  3. On the gateway machine you need to alter the ~/.ssh/authorized_keys such that at the beginning of the line that specifies your client's public key, add the forced command as follows:

    command="ssh -A [email protected]" ...yourPublicKey....

The -A is to forward the agent if you don't like to send passwords all the time...

This way, anytime you do something like ssh WhatYouWillCallTheConnection it will run straight through the gateway and connect you to the server on the other side transparently.

Using SSH there is a clear solution:

  1. on your local machine set up your ~/.ssh/config such that it has the following:

     host WhatYouWillCallTheConnection
         hostname the.gateway.server.address.com
         user YourUsernameOnTheGateway
    
  2. On both the gateway and the end server you'd like to connect to, make sure that you have your local client's public keys located in the ~/.ssh/authorized_keys

  3. On the gateway machine you need to alter the ~/.ssh/authorized_keys such that at the beginning of the line that specifies your client's public key, add the forced command as follows:

     command="ssh -A [email protected]" ...yourPublicKey....
    

The -A is to forward the agent if you don't like to send passwords all the time...

This way, anytime you do something like ssh WhatYouWillCallTheConnection it will run straight through the gateway and connect you to the server on the other side transparently.

Source Link
Shamster
  • 242
  • 1
  • 2

using SSH there is a clear solution:

  1. on your local machine set up your ~/.ssh/config such that it has the following:

    host WhatYouWillCallTheConnection hostname the.gateway.server.address.com user YourUsernameOnTheGateway

  2. On both the gateway and the end server you'd like to connect to, make sure that you have your local client's public keys located in the ~/.ssh/authorized_keys

  3. On the gateway machine you need to alter the ~/.ssh/authorized_keys such that at the beginning of the line that specifies your client's public key, add the forced command as follows:

    command="ssh -A [email protected]" ...yourPublicKey....

The -A is to forward the agent if you don't like to send passwords all the time...

This way, anytime you do something like ssh WhatYouWillCallTheConnection it will run straight through the gateway and connect you to the server on the other side transparently.