2014年4月18日 星期五

CentOS 禁止使用 root 做遠端 ssh 登入

為了資安考量,應避免可用 root 直接透過 ssh 登入OS,故作以下設定:

1. 更新 sshd_config 設定:
cd /etc/ssh
vim sshd_config

#PermitRootLogin Yes 改為 PermitRootLogin No,儲存並離開 (:wq! )

2. 重啟 ssh 服務
cd /etc/init.d
./sshd restart