3 ms·
My hardened ~/.ssh/config on OS X 10.11: Host * Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr MACs h
by slasaus 11y ago
My hardened ~/.ssh/config on OS X 10.11:
Host *
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
HostKeyAlgorithms ssh-ed25519,ssh-rsa
ChallengeResponseAuthentication no
UseRoaming no
If you only connect to newer servers you can further restrict ciphers to only use AEADs (only list the chacha20-poly1305 and aes-gcm ciphers). I assume using AEADs-only makes the MACs keyword obsolete, is this correct?
Config is based on tips from https://stribika.github.io/2015/01/04/secure-secure-shell.html https://stribika.github.io/2015/01/04/secure-secure-shell.ht...
- ehPReth 11y agoMozilla also maintains a SSH guide for both clients and servers: https://wiki.mozilla.org/Security/Guidelines/OpenSSH https://wiki.mozilla.org/Security/Guidelines/OpenSSH
- zackelan 11y ago> I assume using AEADs-only makes the MACs keyword obsolete, is this correct? Correct. You can test this by running SSH with -v/--verbose and observing these log lines: debug1: kex: server->client aes256-gcm@openssh.com <implicit> none debug1: kex: client->server aes256-gcm@openssh.com <implicit> none When using a cipher that does not support AEAD, the 2nd field will include the MAC instead of <implicit> debug1: kex: server->client aes256-ctr hmac-sha2-256-etm@openssh.com none debug1: kex: client->server aes256-ctr hmac-sha2-256-etm@openssh.com none I wasn't sure what the 3rd "none" field is, but after some digging it appears to be the compression algorithm: https://github.com/openssh/openssh-portable/blob/master/kex.c#L818 https://github.com/openssh/openssh-portable/blob/master/kex.... And I confirmed this with ssh -C: debug1: kex: server->client aes256-ctr hmac-sha2-256-etm@openssh.com zlib@openssh.com debug1: kex: client->server aes256-ctr hmac-sha2-256-etm@openssh.com zlib@openssh.com
- grawlinson 11y agoFunny story, I erroneously threw `UseRoaming no` on my server config and freaked the fuck out when I couldn't get into via SSH. Six rescue sessions later, I figured out it shouldn't have been there ... In the future, I'm definitely going to read documentation & test config files (sshd -t -f /path/to/sshd_config, in this case) EDIT: Moral of the story, I am not a smart person sometimes.