4 ms·
I love the multiplexing feature. We have a client who require password, ssh key and MFA. All services are behind a bastion host, which only accepts trafic from
by mrweasel 7y ago
I love the multiplexing feature. We have a client who require password, ssh key and MFA. All services are behind a bastion host, which only accepts trafic from select IPs. SSH multiplexing and proxy configuration allows me to enter the password and TOTP just once instead of every time I need to access a service behind the bastion host.
- zengargoyle 7y agoOf course if the multiplex stalls or goes down so do all of the connections you have running through it. It's like screwing up Gnome Terminal or similar that uses a main server and multiple clients. Screw one pooch and you're whole session of things is similarly screwed.
- MawKKe 7y agoAnother annoying "feature" is that opening a new shell with ssh -X will not enable the forwarding if the original master connection was not enabled with it.
- mrweasel 7y agoTrue, but I never see SSH go down, unless there's a network issue, in which case I lose all my connections anyway.
- beagle3 7y agoIndeed; however, if you have a lingering control file (because an old ssh process was killed, or there was a power failure and it was somehow not removed), it will either refuse to use it, or (occasionally, and I haven't been able to pinpoint when), would just wait there forever. edit: a typo
- dkdk8283 7y agoSounds more like a bug than a disadvantage
- jarvist 7y agoI have these shell aliases configured, to check and delete the master connections. (Often I end up with stale connections when I have a VPN up, and then just sleep my laptop.) alias ssh-MasterConnection-check="ssh -O check " alias ssh-MasterConnection-exit="ssh -O exit " + then you use them as 'ssh-MasterConnection-check host' etc.
- modo_ 7y agoIs there much of an upside to doing the multiplexing on the client side instead of on the server (with something like tmux)? It seems to me like the session persistence tmux gives would be worthwhile if you have a lot of simultaneous sessions going.
- Steltek 7y agoscp and sftp will multiplex too. Remote tab-completion for file transfers also becomes much more approachable this way. scp remote:~/err[tab] .[enter] Also, bastion connections get multiplexed as well so connecting to multiple different hosts behind the bastion goes faster.
- mmalone 7y agoSo you’re saying SCP will tab complete through the control master socket? Neat.
- dkdk8283 7y agoI never saw the value of tmux unless your running a command that can’t be interrupted. Having multiple windows vs tabs on my desktop seems so much easier.
- kilolima 7y agoYes, I agree. What is the usage for tmux? Multiple tabs on a quake-style dropdown terminal on a desktop (like guake) does seem much easier than tmux, especially when gnu-screen is always available when you need to run an uninteruptible command. From what I gather, tmux is useful if you are basically running a persistent remote workspace via terminal on a server and treat your desktop like a thin-client, is that correct?
- m463 7y agofor me this is a common pattern: ssh x then in other windows, I do things like this: scp file x: ssh x command rsync from/ x:to/ emacs /ssh:x:filename (this is tramp mode) edit: one more thing ssh x -o BatchMode=yes command if you have an automatic script to run on a remote machine, adding BatchMode=yes will make it error out instead of stopping and asking for a password