Security

How to Enable/Disable Root Login to SSH

This article is going to show you how to disable and enable root login through SSH.

How to enable root login through SSH: 1.) Login as a root user (as always) 2.) Modify the following file with your favorite text editor:

/etc/ssh/sshd_config

3.) Find the line that says:

PermitRootLogin No

4.) Change no to yes More >

How to change SSH port

How to change your SSH port

Login to your server via SSH as a user with root permissions (i.e. Sudo).

Changing the port:

After you have logged into your server, edit the following file with your favorite editor:

/etc/ssh/sshd_config

This file should look like:

 

Modify the line that says Port 22 and change it to whatever More >

How to add SSH user in CentOS

How to add an SSH user in CentOS

 

Login to your server as a user with root privilages (i.e. Sudo)

1.) Adding the user

Run the following command:

adduser username

Replace username with the username you desire.

2.) Changing the password

You must change the password for the account, so they can login to SSH. Do that More >

Open a port in IPTables, CSF, and APF

Login to your server through an SSH client, as root, or a user with root access. For example, you can use sudo.

How to open a port in IPTables: While you’re logged into your server as root, enter the following command:

iptables -A INPUT -p tcp --dport 2523 -j ACCEPT

Modify the 2523 More >