气氛如此安详 發表於 2023-9-7 00:00:00

Ubuntu20.04开启root账户的方法步骤

<p>
        Ubuntu20.04安装完成之后默认是没有root账户登录权限的,按照以下步骤即可实现开机一步完成root账户登录,看完你会不会觉得很方便呢</p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/8cb9343922952e080cb1f2b8f4b23e89.jpg"></p>
<p>
        <span><strong>1. 第一步</strong></span></p>
<p>
        以普通用户登录系统,创建root用户的密码</p>
<p>
        在终端输入命令:<code>sudo passwd root</code></p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/9ae8c5d8e12b239b1deccd615b4ff4ad.jpg"></p>
<p>
        然后输入设置的密码,输入两次,这样就完成了设置root用户密码了(注意Linux系统下密码是没有回显的)</p>
<p>
        <span><strong>2. 第二步</strong></span></p>
<p>
        修改 50-ubuntu.conf 文件</p>
<p>
        在终端输入命令:<code>sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf</code></p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/d721d542ca35ae1fedc5a4b96918b8b5.jpg"></p>
<p>
        在文件末尾增加如下两行:</p>
<div class="jb51code">
        <div>
                <div class="syntaxhighlighterplain" id="highlighter_827245">
                        <div class="toolbar">
                                <span>?</span>
</div>
                        <table border="0" cellpadding="0" cellspacing="0"><tbody><tr>
<td class="gutter">
                                                        <div class="line number1 index0 alt2">
                                                                1</div>
                                                        <div class="line number2 index1 alt1">
                                                                2</div>
                                                </td>
                                                <td class="code">
                                                        <div class="container">
                                                                <div class="line number1 index0 alt2">
                                                                        <code class="plain plain">greeter-show-manual-login=true</code>
</div>
                                                                <div class="line number2 index1 alt1">
                                                                        <code class="plain plain">all-guest=false</code>
</div>
                                                        </div>
                                                </td>
                                        </tr></tbody></table>
</div>
        </div>
        <div class="codetool" id="codetool">
                <div class="code_n">
                        <textarea></textarea>
</div>
        </div>
</div>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/7d0ab401ccf77c86c95f03bb0e7e120e.jpg"></p>
<p>
        <span><strong>3. 第三步</strong></span></p>
<p>
        修改 gdm-autologin 文件</p>
<p>
        在终端输入命令:<code>sudo gedit /etc/pam.d/gdm-autologin</code> 打开文件</p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/a62a52c85f0e15c1938764a6bf3e6b21.jpg"></p>
<p>
        前面加 # 注释掉第三行的 <em>auth required pam_succeed_if.so user != root quiet_success</em></p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/7668816dac2c94c96da4fb79175e5f79.jpg"></p>
<p>
        <span><strong>4. 第四步</strong></span></p>
<p>
        修改 gdm-password 文件</p>
<p>
        在终端输入命令:<code>sudo gedit /etc/pam.d/gdm-password</code> 打开文件</p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/360e6e7fac1eec0b716d2dee4d23b0f3.jpg"></p>
<p>
        前面加 # 注释掉第三行的 <em>auth required pam_succeed_if.so user != root quiet_success</em></p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/2eca0bfb44fafc36859478029f33ab9e.jpg"></p>
<p>
        <span><strong>5. 第五步</strong></span></p>
<p>
        修改 /root/.profile 文件</p>
<p>
        在终端输入命令:<code>sudo gedit /root/.profile</code> 打开文件</p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/1875b00745a5a0f97b653dabaf22db5f.jpg"></p>
<p>
        将文件末尾的 <code>mesg n 2&gt; /dev/null || true </code>这一行修改成<br><code>tty -s&amp;&amp;mesg n || true</code></p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/8a24eaa6c46ebbc2a822938290b0d9a2.jpg"></p>
<p>
        <span><strong>6. 最后一步</strong></span></p>
<p>
        赶紧注销重新登录试一下吧</p>
<p>
        选择 <kbd>未列出?</kbd><br>
        然后输入root以及你之前设置的密码,即可成功登录</p>
<p>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu20.04开启root账户的方法步骤" alt="Ubuntu20.04开启root账户的方法步骤" src="https://zhuji.jb51.net/uploads/img/202305/ee975732124ed39130e6852d79defc52.jpg"></p>
<p>
         </p>
<p>
        下一篇文章将和大家分享如何将Windows操作系统中的文字复制粘贴到VMware虚拟机下的Linux系统</p>
<p>
        到此这篇关于Ubuntu20.04开启root账户的方法步骤的文章就介绍到这了,更多相关Ubuntu20.04开启root账户内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!</p>
<p>
        原文链接:https://blog.csdn.net/wang_space/article/details/107144986</p>
頁: [1]
查看完整版本: Ubuntu20.04开启root账户的方法步骤