I have two servers, A and B. Login to B requires 2FA every time, so I use a ControlMaster to persist the authentication status.
However, I'm using a laptop, which sometimes sleeps and stops all TCP connections. This breaks the ControlMaster Socket.
So I'm using another server as a jump server. I persist the authentication status on A and connect to B from A (ssh a -tt ssh b
). I then write a RemoteCommand ssh -tt -q b
to the ssh config for host a
on my laptop, so I can just run ssh a
.
However, the current setup doesn't work for VSCode's Remote SSH and rsync. How can I make this work?
Solutions I've tried:
- ProxyJump. It don't work because I want to presist the authentication statsu on the jump server. I don't want to only use it as a network gateway.
- Forwarding the 'control master socket` on A to my local laptop, then use it as socket to B. For some reason the ssh session on A isn't responding, so the ssh client on my laptop freezes.
ssh -tt
cannot be used as (a part of a) transport pipe because it will break any protocol that sends binary data. See this question (and the links therein) for some insight:ssh
with separate stdin, stdout, stderr AND tty.