Skip to content

Instantly share code, notes, and snippets.

@Job79
Created January 23, 2022 18:51
Show Gist options
  • Save Job79/607215571ee44326ff8f08c6d36f36b5 to your computer and use it in GitHub Desktop.
Save Job79/607215571ee44326ff8f08c6d36f36b5 to your computer and use it in GitHub Desktop.
Secure public key only openssh daemon configuration.
# Restrict SSH usage
AllowGroups ssh
AuthorizedKeysFile .ssh/authorized_keys
# Ciphers
RekeyLimit 512M 1H
KexAlgorithms [email protected]
Ciphers [email protected],[email protected]
MACs [email protected]
HostKeyAlgorithms ssh-ed25519
# Authentication
PasswordAuthentication no
ChallengeResponseAuthentication no
PubkeyAuthentication yes
# Limit sessions
MaxAuthTries 2
MaxSessions 5
ClientAliveInterval 30
ClientAliveCountMax 6
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no
PrintMotd no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment