往後的日子 發表於 2020-5-13 17:39:00

debian添加用户名到sudoers文件

<p>debian才装完系统使用sudo命令会提示<strong>用户名不在sudoers 文件中。此事将被报告。</strong></p>
<p>这时我们首先用<br>
<code>su -</code><br>
命令输入密码取得root管理员权限,在用<br>
<code>root@debian:~# gedit /etc/sudoers</code><br>
命令打开sudoers文件添加想取得权限的用户名<br>
在root    ALL=(ALL:ALL) ALL 下面添加一行<br>
debian    ALL=(ALL)ALL</p>
<pre><code># Cmnd alias specification

# User privilege specification
root        ALL=(ALL:ALL) ALL
debian    ALL=(ALL)ALL

# Allow members of group sudo to execute any command
%sudo        ALL=(ALL:ALL) ALL
</code></pre>
<p>然后保存退出。<br>
第一个ALL是指网络中的主机,我们后面把它改成了主机名,它指明jack可以在此主机上执行后面的命令。<br>
第二个括号里的ALL是指目标用户,也就是以谁的身份去执行命令。<br>
最后一个ALL当然就是指命令名了。</p><br><br>
来源:https://www.cnblogs.com/mengydz/p/12883783.html
頁: [1]
查看完整版本: debian添加用户名到sudoers文件