Cyril Deba
Cyril Deba

Reputation: 1210

Jenkins Double SSH Remote Connection

I have a bit unusual environment. In order to connect to the machine B via ssh, I need connect to the machine A and from that box, connect to B, and execute a number of commands there.

Local --ssh--> Machine A --ssh--> Machine B (some commands to execute here)

Generally speaking, Machine A is my entry point to all servers.

I am trying to automate the deployment process with Jenkins and wondering, if it supports such unusual scenario.

So far, I installed the SSH plugin and able to connect to Machine A, yet I am struggling with a connection to Machine B. The jenkins process freezes on the ssh command to Machine B and nothing happens.

Does anyone have any ideas how I can make such scenario work?

Upvotes: 1

Views: 2965

Answers (1)

user2926055
user2926055

Reputation: 1991

The term for Machine A is a "bastion host", which might help your googling.

This link calls it a "jump host", and describes a number of ways to use SSH's ProxyCommand setting to setup all manner of inter-host SSH communication:

https://www.cyberciti.biz/faq/linux-unix-ssh-proxycommand-passing-through-one-host-gateway-server/

Upvotes: 2

Related Questions