Securing SSH - eamonstackpole/my-tech-journal GitHub Wiki

  • TIP: If adding code to the file, put it near the Authentication section of the file for easy navigation later

Securing SSH for Root User

  • vi /etc/ssh/sshd_config - opens the sshd config file using VIM allowing you to edit it
  • Scroll until you find Authentications, then find PermitRootLogin
  • edit the file so PermitRootLogin is set to "no"
  • save the file
  • Restart SSH
    • systemctl restart sshd

Securing SSH for other Users

Securing Groups

  • vi /etc/ssh/sshd_config - opens the sshd config file using VIM allowing you to edit it
  • Edit the file and add "DenyGroups [group name]" to the file
  • save the file and restart SSH

Securing Users

  • vi /etc/ssh/sshd_config - opens the sshd config file using VIM allowing you to edit it
  • Edit the file and add "DenyUsers [user's name]" to the file
  • save the file and restart SSH