Changing the default SSH port number and not allowing root logins on Debian.
The Secure Shell Protocol (OpenSSH is a FREE version of SSH) by default uses port 22. Changing the default SSH port will stop many automated
attacks and make it harder to guess which port SSH is accessible from.
1.) As root, use your favorite text editor (nano) to edit the sshd configuration file.
2.) Edit the line which states 'Port 22'. Choose a port not currently used on the system. I used 'Port 49999' for this example.
3.) While we have sshd_config in our editor, lets disable root login
through SSH. Look for 'Authentication' section and change
'PermitRootLogin' to 'no'.
4.) You need to restart SSH daemon for changes to take effect.
5.) Before disconnecting from your current SSH session, verify SSH is
listening on the new port by connecting to it from another terminal.
No comments:
Post a Comment