Skip to main content
Updated ability to use agent to connect
Source Link
Eric B.
  • 665
  • 2
  • 7
  • 12

Is there a way in a single SSH command to login via SSH to a remote server passing through an intermediate server? In essence, I need to create a tunnel to my "bridge server" and via the tunnel to login to the remote server.

For example, I'm trying to compress the following into a single ssh command:

  1. ssh -N -L 2222:remoteserver.com:22 [email protected]
  2. ssh -p 2222 remote_userid@localhost

This currently works, but I would rather be able to squeeze everything into a single command such that if I exit my ssh shell, my tunnel closes at the same time.

I have tried the following in my config but to no avail:

Host axp
  User          remote_userid
  HostName      remoteserver.com
  IdentityFile  ~/.ssh/id_rsa.eric
  ProxyCommand  ssh -W %h:%p  [email protected]

As per @jasonwryan comments and the transparent-mulithop link, I have tried running ssh -A [email protected] and fromI'm able to get the bridgemachine running ssh [email protected],following command working:

ssh -A -t [email protected] ssh -A [email protected]

but it is not pickingnow I would like to package that up my ssh key onneatly into my local machine.ssh/config file, and prompting me fornot quite sure what I need to use as my passwordProxyCommand.

I've I've seen a couple of links online as well as @boomshadow's answer that requires nc, but unfortunately the AIX server I'm using as my bridge machine does not have netcat installed on it.

Is there a way in a single SSH command to login via SSH to a remote server passing through an intermediate server? In essence, I need to create a tunnel to my "bridge server" and via the tunnel to login to the remote server.

For example, I'm trying to compress the following into a single ssh command:

  1. ssh -N -L 2222:remoteserver.com:22 [email protected]
  2. ssh -p 2222 remote_userid@localhost

This currently works, but I would rather be able to squeeze everything into a single command such that if I exit my ssh shell, my tunnel closes at the same time.

I have tried the following in my config but to no avail:

Host axp
  User          remote_userid
  HostName      remoteserver.com
  IdentityFile  ~/.ssh/id_rsa.eric
  ProxyCommand  ssh -W %h:%p  [email protected]

As per @jasonwryan comments and the transparent-mulithop link, I have tried running ssh -A [email protected] and from the bridgemachine running ssh [email protected], but it is not picking up my ssh key on my local machine and prompting me for my password.

I've seen a couple of links online as well as @boomshadow's answer that requires nc, but unfortunately the AIX server I'm using as my bridge machine does not have netcat installed on it.

Is there a way in a single SSH command to login via SSH to a remote server passing through an intermediate server? In essence, I need to create a tunnel to my "bridge server" and via the tunnel to login to the remote server.

For example, I'm trying to compress the following into a single ssh command:

  1. ssh -N -L 2222:remoteserver.com:22 [email protected]
  2. ssh -p 2222 remote_userid@localhost

This currently works, but I would rather be able to squeeze everything into a single command such that if I exit my ssh shell, my tunnel closes at the same time.

I have tried the following in my config but to no avail:

Host axp
  User          remote_userid
  HostName      remoteserver.com
  IdentityFile  ~/.ssh/id_rsa.eric
  ProxyCommand  ssh -W %h:%p  [email protected]

As per @jasonwryan comments and the transparent-mulithop link, I'm able to get the following command working:

ssh -A -t [email protected] ssh -A [email protected]

but now I would like to package that up neatly into my .ssh/config file, and not quite sure what I need to use as my ProxyCommand. I've seen a couple of links online as well as @boomshadow's answer that requires nc, but unfortunately the AIX server I'm using as my bridge machine does not have netcat installed on it.

added 207 characters in body
Source Link
Eric B.
  • 665
  • 2
  • 7
  • 12

Is there a way in a single SSH command to login via SSH to a remote server passing through an intermediate server? In essence, I need to create a tunnel to my "bridge server" and via the tunnel to login to the remote server.

For example, I'm trying to compress the following into a single ssh command:

  1. ssh -N -L 2222:remoteserver.com:22 [email protected]
  2. ssh -p 2222 remote_userid@localhost

This currently works, but I would rather be able to squeeze everything into a single command such that if I exit my ssh shell, my tunnel closes at the same time.

I have tried the following in my config but to no avail:

Host axp
  User          remote_userid
  HostName      remoteserver.com
  IdentityFile  ~/.ssh/id_rsa.eric
  ProxyCommand  ssh -W %h:%p  [email protected]

As per @jasonwryan comments and linkthe transparent-mulithop link, I have tried running ssh -A [email protected] and from the bridgemachine running ssh [email protected], but it is not picking up my ssh key on my local machine and prompting me for my password.

I've seen a couple of links online as well as @boomshadow's answer that requires nc, but unfortunately the AIX server I'm using as my bridge machine does not have netcat installed on it.

Is there a way in a single SSH command to login via SSH to a remote server passing through an intermediate server? In essence, I need to create a tunnel to my "bridge server" and via the tunnel to login to the remote server.

For example, I'm trying to compress the following into a single ssh command:

  1. ssh -N -L 2222:remoteserver.com:22 [email protected]
  2. ssh -p 2222 remote_userid@localhost

This currently works, but I would rather be able to squeeze everything into a single command such that if I exit my ssh shell, my tunnel closes at the same time.

I have tried the following in my config but to no avail:

Host axp
  User          remote_userid
  HostName      remoteserver.com
  IdentityFile  ~/.ssh/id_rsa.eric
  ProxyCommand  ssh -W %h:%p  [email protected]

As per @jasonwryan comments and link, I have tried running ssh -A [email protected] and from the bridgemachine running ssh [email protected], but it is not picking up my ssh key on my local machine and prompting me for my password.

Is there a way in a single SSH command to login via SSH to a remote server passing through an intermediate server? In essence, I need to create a tunnel to my "bridge server" and via the tunnel to login to the remote server.

For example, I'm trying to compress the following into a single ssh command:

  1. ssh -N -L 2222:remoteserver.com:22 [email protected]
  2. ssh -p 2222 remote_userid@localhost

This currently works, but I would rather be able to squeeze everything into a single command such that if I exit my ssh shell, my tunnel closes at the same time.

I have tried the following in my config but to no avail:

Host axp
  User          remote_userid
  HostName      remoteserver.com
  IdentityFile  ~/.ssh/id_rsa.eric
  ProxyCommand  ssh -W %h:%p  [email protected]

As per @jasonwryan comments and the transparent-mulithop link, I have tried running ssh -A [email protected] and from the bridgemachine running ssh [email protected], but it is not picking up my ssh key on my local machine and prompting me for my password.

I've seen a couple of links online as well as @boomshadow's answer that requires nc, but unfortunately the AIX server I'm using as my bridge machine does not have netcat installed on it.

added 35 characters in body
Source Link
Eric B.
  • 665
  • 2
  • 7
  • 12

Is there a way in a single SSH command to login via SSH to a remote server passing through an intermediate server? In essence, I need to create a tunnel to my "bridge server" and via the tunnel to login to the remote server.

For example, I'm trying to compress the following into a single ssh command:

  1. ssh -N -L 2222:remoteserver.com:22 [email protected]
  2. ssh -p 2222 remote_userid@localhost

This currently works, but I would rather be able to squeeze everything into a single command such that if I exit my ssh shell, my tunnel closes at the same time.

I have tried the following in my config but to no avail:

Host axp
  User          remote_userid
  HostName      remoteserver.com
  IdentityFile  ~/.ssh/id_rsa.eric
  ProxyCommand  ssh -W %h:%p  [email protected]

As per @jasonwryan comments and link, I have tried running ssh -A [email protected] and from the bridgemachine running ssh remote_userid@remoteserver-Aremote_userid@remoteserver.com, but it is not picking up my ssh key on my local machine and prompting me for my password.

Is there a way in a single SSH command to login via SSH to a remote server passing through an intermediate server? In essence, I need to create a tunnel to my "bridge server" and via the tunnel to login to the remote server.

For example, I'm trying to compress the following into a single ssh command:

  1. ssh -N -L 2222:remoteserver.com:22 [email protected]
  2. ssh -p 2222 remote_userid@localhost

This currently works, but I would rather be able to squeeze everything into a single command such that if I exit my ssh shell, my tunnel closes at the same time.

I have tried the following in my config but to no avail:

Host axp
  User          remote_userid
  HostName      remoteserver.com
  IdentityFile  ~/.ssh/id_rsa.eric
  ProxyCommand  ssh -W %h:%p  [email protected]

As per @jasonwryan comments and link, I have tried running ssh -A [email protected] and from the bridgemachine running ssh remote_userid@remoteserver.com, but it is not picking up my ssh key on my local machine.

Is there a way in a single SSH command to login via SSH to a remote server passing through an intermediate server? In essence, I need to create a tunnel to my "bridge server" and via the tunnel to login to the remote server.

For example, I'm trying to compress the following into a single ssh command:

  1. ssh -N -L 2222:remoteserver.com:22 [email protected]
  2. ssh -p 2222 remote_userid@localhost

This currently works, but I would rather be able to squeeze everything into a single command such that if I exit my ssh shell, my tunnel closes at the same time.

I have tried the following in my config but to no avail:

Host axp
  User          remote_userid
  HostName      remoteserver.com
  IdentityFile  ~/.ssh/id_rsa.eric
  ProxyCommand  ssh -W %h:%p  [email protected]

As per @jasonwryan comments and link, I have tried running ssh -A [email protected] and from the bridgemachine running ssh -Aremote_userid@remoteserver.com, but it is not picking up my ssh key on my local machine and prompting me for my password.

added 255 characters in body
Source Link
Eric B.
  • 665
  • 2
  • 7
  • 12
Loading
Source Link
Eric B.
  • 665
  • 2
  • 7
  • 12
Loading