码迷,mamicode.com
首页 > 系统相关 > 详细

解决shell命令"** is not in the sudoers file..."错误

时间:2017-02-18 23:07:42      阅读:728      评论:0      收藏:0      [点我收藏+]

标签:命令   com   bsp   sudoers   etc   host   为什么   nbsp   root   

Linux中新建的普通用户一般不会分配给root权限,每次都su root也太麻烦,可以通过在/etc/sudoers文件中添加当前用户的方式,给当前用户赋予sudo命令的使用权限。

 

# 切换到root用户
echo `whoami`" ALL=(ALL) ALL" >> /etc/sudoers

 

/etc/sudoers文件中配置的通用格式是:

user host=(run_as) command

其中,

user 用户名,需要添加的用户名

host 一个或多个主机名,一般写ALL

run_as 作为什么用户执行,通常是root或者ALL

command 允许以指定的用户执行的命令,可以是ALL或者指定的命令

 

 

* 网络搜索结果汇总而来,仅作备忘

 

解决shell命令"** is not in the sudoers file..."错误

标签:命令   com   bsp   sudoers   etc   host   为什么   nbsp   root   

原文地址:http://www.cnblogs.com/harelion/p/6414305.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!