Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
SSH Security Best Practices

SSH Security Best Practices

On /etc/ssh/sshd_config:

  1. Disable Root Logins

Best: PermitRootLogin no
Good: PermitRootLogin without-password (requires PubkeyAuthentication yes)

  1. Limit user Logins
AllowUsers alice bob
  1. Disable Protocol 1
Protocol 2
  1. Use a Non-Standard Port
Port 2345
  1. Use Public/Private Keys for Authentication
PubkeyAuthentication yes

Disable password authentication forcing use of keys:

PasswordAuthentication no


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment