/etc/ssh/sshd_config file. After making any changes, restart the SSH service to apply them.
Disable Password Authentication
If you have configured SSH keys, disable password authentication to improve security. SSH key-based auth is significantly harder to brute-force.Change the SSH Daemon Port
By default, SSH listens on port 22. Changing this to a non-standard port reduces exposure to automated scanning and brute-force attempts.After changing the port, connect using
ssh -p 1234 username@host or update your host configuration file.Limit Which Users Can Log In
Restrict SSH access to specific users or groups to reduce the attack surface.Disable Root Login
Allowing direct root login over SSH is a significant security risk. It is best practice to disable it and use a regular user withsudo instead.