Score:0

Making two ssh port-forwarding connections in one "go"

bh flag

I have two servers, A and B. I'm connecting to B jumping trough A with ProxyJump, my sshconfig looks something like this:

Host A
...

Host B
...
ProxyJump A

I have applications running on A and B, and I'm doing port-forwarding to my localhost, like this:

ssh A -NL 8888:node:8888 ssh B -NL 9999:node:9999

The problem is that every time I'm connecting to A it requires 2FA. Is there some way I can do these two port-forwards in one "go" without needing to authenticate to A twice? I'd like to not use connection sharing (ControlMaster) if possible as I have ran into issues with this, they port stays blocked after the connection goes down for some time. Or is connection sharing the only way to do it? Perhaps if I use ControlPersist no it will not block the port if I need to reconnect?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.