1.切換到 root 賬戶
sudo -i
2. 設置 root密碼
passwd root
3. 打開sshd_config 配置文件
vi /etc/ssh/sshd_config
5. 修改如下代碼
PermitRootLogin yes //默認為no,需要開啟root用戶訪問改為yes PasswordAuthentication yes //默認為no,改為yes開啟密碼登陸
6.修改完按ESC 然后按shift + : 輸入 wq 回車保存退出
7. 重啟服務器
reboot