红联Linux门户
Linux帮助

在linux系统出现“Sudo提权出现:xx用户不在sudoers文件中解决”

发布时间:2016-02-06 10:10:39来源:linux网站作者:

(一)更改权限

chmod 740 /etc/sudoers


(二)赋予用户权限

1、sudo gedit /etc/sudoers

2、添加你的用户名

Defaults    env_reset
Defaults    mail_badpass
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
 
# Host alias specification
 
# User alias specification
 
# Cmnd alias specification
 
# User privilege specification
root    ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
min ALL=(ALL:ALL) ALL
 
# Allow members of group sudo to execute any command
%sudo    ALL=(ALL) ALL
xx       ALL=(ALL) ALL  (将此处的XX修改为出现改问题的用户名!)


(三)保存后,即完成。


本文永久更新地址:http://www.linuxdiyf.com/linux/17911.html