1. Edit the SSH config file: nano /etc/ssh/sshd_config

  2. Change the default port from 22 to something custom: Port 2222

  3. Disable root login: PermitRootLogin no

  4. Enable public key authentication: PasswordAuthentication no

  5. Restart SSH: systemctl restart sshd

  6. Always test new settings in a secondary session before closing the original.

Was this answer helpful? 0 Users Found This Useful (0 Votes)