I have a relatively full setup for my ~/.ssh/config
. This is what's at the top:
Host *
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
ControlPersist 24h
BatchMode yes
Ciphers blowfish-cbc
Compression yes
VisualHostKey yes
I want to make it such that ControlMaster
etc do not apply to github; they
apparently actively disconnect these persistent connections, which I understand
and respect.
So to be clear:
$ rm /tmp/ssh_mux_*
$ ssh git@github.com
PTY allocation request failed
Hi frioux! You've successfully authenticated, but GitHub does not provide shell access.
Shared connection to github.com closed.
$ ls /tmp/ssh_mux_*
/tmp/ssh_mux_github.com_22_git
So I read some docs, I asked in IRC, and this is what I ended up with:
Host !github.com
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
ControlPersist 24h
Host *
BatchMode yes
Ciphers blowfish-cbc
Compression yes
VisualHostKey yes
So now github correctly does not use ControlMaster:
$ rm /tmp/ssh_mux_*
$ ssh git@github.com
Host key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
+--[ RSA 2048]----+
| . |
| + . |
| . B . |
| o * + |
| X * S |
| + O o . . |
| . E . o |
| . . o |
| . . |
+-----------------+
PTY allocation request failed
Hi frioux! You've successfully authenticated, but GitHub does not provide shell access.
Shared connection to github.com closed.
$ ls /tmp/ssh_mux_*
But neither does anything else:
$ rm /tmp/ssh_mux_*
$ ssh cs ls
Host key fingerprint is 89:d1:40:7f:0d:11:28:10:ce:23:e6:a9:12:9d:a1:5b
+--[ RSA 2048]----+
| o+o .+o |
| o .+. o |
| + + ..o . . |
| = = . o o |
|o E . S |
| = |
|+ |
|. |
| |
+-----------------+
/home/frew
bin
code
irclogs
lib
out
test
$ ls /tmp/ssh_mux_*
I tried making the host line Host !github.com, *
and Host *, !github.com
but
as far as I can tell when I do that it always applies to github.
How can I do what I want?