1. Check SSH server status:

#service sshd status

If installed and running, the output should resemble:

“sshd (pid 9488 9486 1850) is running...”

If not installed, use the following command to install and start SSH server:

#yum install -y openssh openssh-server openssh-clients openssl-libs && service sshd start

2. Edit SSH configuration to enable root login:

#vi /etc/ssh/sshd_config

Find the line:

#PermitRootLogin without-password

Remove ‘#’ and change ‘without-password’ to ‘yes’:

PermitRootLogin yes

Save the file:

Press "ESC", type :wq (or :x), and hit/press "ENTER"

3. Restart SSH service:

#service sshd restart

Quick Guide Commands:

Check sshd status:
#service sshd status

Install sshd:
#yum install -y openssh openssh-server openssh-clients openssl-libs

Start sshd:
#service sshd start

Stop sshd (be cautious when running this command):
#service sshd stop

Reload sshd:
#service sshd reload

If you find the process complicated or feel insecure, you can request assistance from our system admins to enable or disable root login through SSH on your CentOS server.

```

Ha estat útil la resposta? 109 Els usuaris han Trobat Això Útil (109 Vots)