Linux给用户添加sudo权限

linux下,一般用户运行sudo命令时会出现错误提示: 
如vurtne is not in the sudoers file.  This incident will be reported. 
这里,vurtne是一般用户名称,然后导致无法执行sudo命令,这时候,如下解决:
  1. 进入超级用户模式,也就是用root登录系统。
  2. 给/etc/sudoers文件添加写入权限:chmod u+w /etc/sudoers
  3. 编辑/etc/sudoers文件。
          vim /etc/sudoers
   在root ALL=(ALL) ALL下面添加vurtne ALL=(ALL) ALL(这里的vurtne换成你的用户名),然后保存退出。
  4.撤销/etc/sudoers文件的写入权限:chmod u-w /etc/sudoers
然后一般用户就可以正常使用sudo命令了。
posted @ 2017-04-20 17:48  yancy.lu  阅读(1453)  评论(0编辑  收藏  举报