切換到root用戶:sudo -

編輯配置文件:vim /etc/ssh/sshd_config(注意是sshd_congfig不是ssh_config)
修改參數(shù):


PermitRootLogin yes(這個(gè)參數(shù)可能沒有,直接加到文件最后一行就行了)
PasswordAuthentication yes
參數(shù)含義
PermitRootLogin 如果為yes則允許root遠(yuǎn)程登錄
PasswordAuthentication如果為yes則允許密碼身份驗(yàn)證。如果為no,需要其他身份驗(yàn)證方式,如公鑰身份驗(yàn)證
修改root密碼:passwd
重啟ssh服務(wù):systemctl? restart? ssh