©2018 by Zach Pfeffer

SEARCH THIS SITE

SSH Directly to a Machine You'd Normally Need to SSH Into a Server to Get To

March 26, 2018

 

This post lists the steps needed to connect to an ssh server beyond an ssh server you have to connect to, to to get to it from a Linux host using OpenSSH.

 

Note

 

remote.server.com is the server you ssh into to ssh into the other server

sshbeyondremote.server.com is the server you ssh into from remote.server.com

Replace these names with the names you use when you apply these steps.

 

 

Steps

 

1. ssh into remote.server.com from your machine

 

2. Edit ~/.ssh/authorized_keys and add the public part of ~/.ssh/keys/key1/openssh.keyforremote.priv

 

3. ssh into sshbeyondremote.server.com from remote.server.com

 

4. Edit ~/.ssh/authorized_keys and add the public part of ~/.ssh/keys/key1/openssh.keyforsshbeyondremote.priv

 

5. Log out of sshbeyondremote.server.com

 

6. Check that AllowTcpForwarding yes in /etc/ssh/sshd_config on remote.server.com

 

Note, you may have the following:

 

 Big, big warning: you have to ensure that you use the same case in /etc/ssh/sshd_config and in ~/.ssh/config if you use PermitOpen. This seems like a bug because DNS names are case insensitive. If you don't do this you may see:

 

7. From your machine add the following to ~/.ssh/config

 

8. Now you should be able to run this from your machine:

 

References

 

Versions

 

Version of the OpenSSH client:

Version of the OpenSSH server:

 

Please reload

Our Recent Posts

A Fix for "You don't have permission to create items on this site: https://yoursite.sharepoint.com/sites/pwa"

September 25, 2019

Create a Tree-View of a Directory on Linux with 'tree'

August 17, 2019

Use draw.io in Google Drive (and Get Rid of draw.io )

June 30, 2019

1/1
Please reload

Tags

Please reload