Linux 云主機怎樣切換密鑰登錄為密碼登錄?
更新時間 2023-09-08 23:22:15
最近更新時間: 2023-09-08 23:22:15
分享文章
操作場景
本節操作介紹Linux云服務器切換密鑰登錄為密碼登錄的操作步驟。
操作步驟
-
使用root身份編輯Linux云服務器的ssh配置文件。
su root
vim /etc/ssh/sshd_config修改如下配置項:
–把PasswordAuthentication no 改為 PasswordAuthentication yes。

–把PermitRootLogin no 改為 PermitRootLogin yes。

-
重啟sshd服務使配置生效,并查看服務狀態。
systemctl restart sshd systemctl status sshd -
設置root密碼,然后就可以通過密碼遠程登錄云主機。
passwd root