The setup is as follows:
- Local PC from which I want to ssh into…
- Gateway node
gateway
which is an intermediate node which is only used to ssh into… - Front node
front
, again an intermediate node, required to ssh into the final… - Compute node, which is the node I actually want to use
I want to setup my local ssh config such that I can directly type ssh compute
.
The problem: As opposed to gateway
and front
, the hostname for the compute node is not static (i.e. it may change multiple times in one day). I have a script compute_node_hostname.sh
on front
which will output the name of the compute node, i.e. node339
. How can I use it in my config?
The following simple config with the compute node hardcoded does work:
Host gateway front compute
User …
IdentityFile ~/.ssh/id_rsa
Host front
HostName front
ProxyJump gateway
Host compute
HostName node339
ProxyJump front
Constraint: I cannot use RemoteCommand
in my config