












Ubuntu 系統的默認用戶名是 ubuntu,並在安裝過程中默認不設置 root 帳戶和密碼。
其實之前文章中有過介紹,不過在實際使用中發現跟在甲骨文中有些不一樣,重新記錄一下。
使用 ubuntu 賬號登錄服務器。
執行以下命令,設置 root 密碼:
sudopasswd root
輸入 root 的密碼,按 Enter。
重複輸入 root 的密碼,按 Enter。返回如下信息,即表示 root 密碼設置成功。
passwd: password updated successfully
執行以下命令,打開 sshd_config 配置文件。
sudo vi /etc/ssh/sshd_config
#Authentication,將 PermitRootLogin 參數修改為 yes。如果 PermitRootLogin 參數被註釋,請去掉首行的註釋符號(#)。#Authentication,將 PasswordAuthentication 參數修改為 yes。sshd_config 配置文件中無此配置項,則添加 PasswordAuthentication yes 項即可。:wq,保存文件並返回。sudo service ssh restart
root及設置的密碼登錄服務器。此內容由慣性聚合(RSS閱讀器)自動聚合整理,僅供閱讀參考。 原文來自 — 版權歸原作者所有。