The problem 1.0
I'm working on a server that only supports two-factor auth (keypair auth is disabled). So every time my SFTP client wants to upload a file, it asks me for a token... after 3 minutes that becomes a not_very_nice UX.
The solution 1.0
So I learned about SSH multiplexing and now I can open one master connection manually (from the terminal), and all other ssh connections can be multiplexed on top, like so:
$ ssh example_com_master Verification code: (/me enters the token code) Password: (/me enters my pass) Welcome to Ubuntu 14.04 blah blah.... Last login: Wed Oct 1 11:24:15 2014 from 22.214.171.124 $
Then, from another terminal, or by another piece of software:
$ ssh my.example.com Last login: Wed Oct 1 16:34:45 2014 from 126.96.36.199 $
So, mission accomplished, no more entering 2FA token. And no password, for that matter, SSH FTW!
Host example_com_master HostName my.example.com User username PubkeyAuthentication no ControlMaster yes ControlPath ~/.ssh/sockets/example_com ControlPersist 10 Host my.example.com HostName my.example.com User username PubkeyAuthentication no ControlMaster no ControlPath ~/.ssh/sockets/example_com
Problem 2.0 (TLDR)
Some software (e.g. PyCharm IDE) use their own SSH library / binary / whatever!
Meaning that nothing I type in
~/.ssh/config will affect it, AFAIK.
That's my current problem: is there a way to "trick" such software into using an already existing master connection?
An idea: because you can usually configure software to use a different port to connect to, I was wondering if it might be possible to set up some kind of tunneling that will multiplex incoming connections onto existing master. But my foo has failed me...
Main purpose is to connect to remote Python interpreter/debugger.
All the ports are closed other then 22 and 80. It is, however, possible to do:
remote$ ssh localhost:2222 (password or securekey login, both work) remote$
but 2222 in only open for connections from localhost, and admins won't open any additional ports, saying "anyone could use it".