1

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:

  1. 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.
  2. 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.
1

1 Answer 1

0

I suggest creating a tunnel between A and B. Here's a rough a idea that you can test, then feel free to build upon it if it works:

On server a, run the following command

$ ssh -L 444:b:444

(444 is the port, you can replace it by any number you want)

This command will connect you to b and create a tunnel between a and b. Let this terminal run in the background.

Now back on your local computer, you just need to run

ssh a -p 444

And it will take you straight to server b

10
  • 1
    I think any ProxyCommand will conflict with the "I want to presist the authentication status on the jump server" requirement. Even if I'm wrong, the answer is so vague. How exactly can ProxyCommand help? Commented Jun 14 at 10:19
  • Yes, ProxyCommand does work (setting proxycommand to ssh b for host a); however, I want to get VSCode and Rsync working, which doesn't support ProxyCommand.
    – Yuxuan Lu
    Commented Jun 14 at 13:02
  • @KamilMaciorowski I am not familiar with how persistant authentication works. However, OP says he has a command that allows him to do that, so a ProxyCommand statements will let him use that automatically when contacting hostB
    – Cydouzo
    Commented Jun 14 at 14:55
  • @YuxuanLu VsCode documentation states that you can use ProxyCommand (see doc below), and rsync also generally works with ProxyCommand. Can you explain the problem? code.visualstudio.com/blogs/2019/10/03/…
    – Cydouzo
    Commented Jun 14 at 14:55
  • Oh sorry I misread your answer.
    – Yuxuan Lu
    Commented Jun 14 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .