Ubuntu 系統(tǒng)的默認(rèn)用戶名是 ubuntu,并在安裝過程中默認(rèn)不設(shè)置 root 帳戶和密碼。您如有需要,可在設(shè)置中開啟允許 root 用戶登錄。具體操作步驟如下:
1. 使用 ubuntu 帳戶登錄輕量應(yīng)用服務(wù)器。
2. 執(zhí)行以下命令,設(shè)置 root 密碼。
sudo passwd root
3. 輸入 root 的密碼,按 Enter。
4. 重復(fù)輸入 root 的密碼,按 Enter。 返回如下信息,即表示 root 密碼設(shè)置成功。
passwd: password updated successfully
5. 執(zhí)行以下命令,打開 sshd_config
配置文件。
sudo vi /etc/ssh/sshd_config
6.
按 i 切換至編輯模式,找到 #Authentication
,將 PermitRootLogin
參數(shù)修改為 yes
。如果 PermitRootLogin
參數(shù)被注釋,請(qǐng)去掉首行的注釋符號(hào)(#
)。如下圖所示:
7. 找到 #Authentication
,將 PasswordAuthentication
參數(shù)修改為 yes。如下圖所示:
說明
若 sshd_config
配置文件中無此配置項(xiàng),則添加 PasswordAuthentication yes
項(xiàng)即可。
8. 按?Esc,輸入:wq,保存文件并返回。
9. 執(zhí)行以下命令,重啟 ssh 服務(wù)。
sudo service ssh restart
10. 參見使用遠(yuǎn)程登錄軟件登錄 Linux 實(shí)例,并使用以下信息登錄 Ubuntu 輕量應(yīng)用服務(wù)器:
用戶名:root
登錄密碼:在步驟2中已設(shè)置的密碼
?文章來源地址http://www.zghlxwxcb.cn/news/detail-623484.html文章來源:http://www.zghlxwxcb.cn/news/detail-623484.html
?
到了這里,關(guān)于Ubuntu 系統(tǒng)如何使用 root 用戶登錄實(shí)例的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!