Skip to content

Instantly share code, notes, and snippets.

@bwhaley
Created August 17, 2015 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwhaley/15d72a4a5b4cce0eb52f to your computer and use it in GitHub Desktop.
Save bwhaley/15d72a4a5b4cce0eb52f to your computer and use it in GitHub Desktop.
Secure OpenSSH server config
Port 22
Protocol 2
AddressFamily inet
#AllowUsers recommended
AllowUsers someuser,someotheruser
AllowGroups someadmingroup
AllowTcpForwarding yes
Banner /etc/banner
ChallengeResponseAuthentication no
ClientAliveInterval 300
ClientAliveCountMax 3
Compression yes
GatewayPorts no
LogLevel VERBOSE
LoginGraceTime 50s
MaxAuthTries 6
MaxStartups 10
PasswordAuthentication no
PermitEmptyPasswords no
PermitRootLogin no
PermitUserEnvironment no
PidFile /var/run/sshd.pid
PrintLastLog yes
PrintMotd no
PubkeyAuthentication yes
StrictModes yes
Subsystem sftp /usr/libexec/sftp-server
SyslogFacility AUTH
TCPKeepAlive no
UseDNS no
UseLogin no
UsePrivilegeSeparation yes
X11DisplayOffset 10
X11Forwarding no
X11UseLocalhost yes
Ciphers aes256-ctr,aes192-ctr,aes128-ctr
MACs hmac-sha2-512-96,hmac-sha2-512,hmac-sha2-256-96,hmac-sha2-256,hmac-sha1-96,hmac-sha1
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group14-sha1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment