新版ubuntu20.04 使用root用戶登錄系統(tǒng)的詳細教程
ubuntu20.04 默認(rèn)是沒有開啟root登錄的,這在我們桌面操作和配置文件的時候很不方便,于是這里教大家用root直接登錄桌面,這樣操作系統(tǒng)起來非常方便
一:設(shè)置root用戶密碼
在桌面上右鍵鼠標(biāo)選擇Open in Terminal打開終端模擬器
執(zhí)行sudo passwd root
然后輸入設(shè)置的密碼,輸入兩次,這樣就完成了設(shè)置root用戶密碼了
二:修改配置文件
2.1:修改50-ubuntu.conf
執(zhí)行sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf 把配置改為如下所示
[Seat:*] user-session=ubuntu greeter-show-manual-login= true all-guest=false #這個可以 不用配置
2.1:修改gdm-autologin和gdm-password
執(zhí)行sudo vim /etc/pam.d/gdm-autologin 注釋掉auth required pam_succeed_if.so user != root quiet_success這一行(第三行左右)
#%PAM-1.0 auth requisite pam_nologin.so #auth required pam_succeed_if.so user != root quiet_success auth optional pam_gdm.so auth optional pam_gnome_keyring.so auth required pam_permit.so
執(zhí)行sudo vim /etc/pam.d/gdm-password注釋掉 auth required pam_succeed_if.so user != root quiet_success這一行(第三行左右)
#%PAM-1.0 auth requisite pam_nologin.so #auth required pam_succeed_if.so user != root quiet_success @include common-auth auth optional pam_gnome_keyring.so @include common-account
2.2:修改/root/.profile文件
執(zhí)行sudo vim/root/.profile修改配置文件如下
# ~/.profile: executed by Bourne-compatible login shells. if [ "$BASH" ]; then if [ -f ~/.bashrc ]; then . ~/.bashrc fi fi tty -s && mesg n || true mesg n || true
三:重啟系統(tǒng)使其生效
重啟后注銷原來用戶
登錄選擇未列出
登錄root用戶
總結(jié)
到此這篇關(guān)于新版ubuntu20.04 使用root用戶登錄系統(tǒng)的文章就介紹到這了,更多相關(guān)ubuntu20.04 使用root用戶登錄系統(tǒng)內(nèi)容請搜索本站以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持本站!
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。