Securing SSH

Restricting and properly configuring SSH access is an essential step in securing your server.

You can find the SSH configuration file at /etc/ssh/sshd_config

To edit this file, you will need to log into your server as the root user. Once you have logged into your normal user account via SSH, you can become the root user by using the su command. For example:

user@example.com [~]# su -
Password:
root@host [~]#

Editing the SSH Configuration File

To change specific parameters within sshd_config, you need to uncomment the line by removing the number-sign (#) and changing the value for the line. For example, the default SSH port appears in a line like this:

#Port 22

To change the SSH port to 456, you will need to make the line appear like this:

Port 456

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.