ubuntu 系统adduser 的时候添加sudo 的权限

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/liuhaomatou/article/details/76571945
ubuntu下直接运行sudo命令,会提示类似: 
xxxis not in the sudoers file.  This incident will be reported. 
这里,xxx是用户名称,然后导致无法执行sudo命令,这时候,如下解决:
  1. 进入超级用户模式。也就是输入" su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root用)
  2. 编辑/etc/sudoers文件。也就是输入命令" vim /etc/sudoers",进入编辑模式,找到这一 行:" root ALL=(ALL) ALL"在起下面添加" xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存退出。
  3. 然后就行了。

猜你喜欢

转载自blog.csdn.net/liuhaomatou/article/details/76571945