直接rootユーザでログイン出来ると、rootユーザのパスワードが漏れると即システムを乗っ取られてしまうので、rootユーザが直接sshで接続出来ないように設定を行います。
1. 設定ファイルの変更
[root@localhost ~]# vi /etc/ssh/sshd_config
2. sshの再起動
・CentOS7 以上
[root@localhost ~]# systemctl start sshd.service
・CentOS6 以下
[root@localhost ~]# /etc/rc.d/init.d/sshd restart
・Ubuntu
[root@localhost ~]# /etc/init.d/ssh restart
3. ログインの確認
[root@localhost ~]# ssh root@localhost
root@xxxxx.jp(パスワード)
Permission denied, please try again
ログインができなければ、OKです。