找回密码
 骑士注册

QQ登录

微博登录


查看: 429|回复: 3
收起左侧

[求助] Ubuntu 下执行命令 source /etc/sudoers

[复制链接]
carryLess 发表于 2017-09-25 14:10:40 | 显示全部楼层 |阅读模式
Ubuntu 下执行命令 source /etc/sudoers报错如下
WARNING:root:could not open file '/etc/apt/sources.list'

No command 'Defaults' found, did you mean:
Command 'defaults' from package 'gnustep-base-runtime' (universe)
Defaults: command not found
WARNING:root:could not open file '/etc/apt/sources.list'

No command 'Defaults' found, did you mean:
Command 'defaults' from package 'gnustep-base-runtime' (universe)
Defaults: command not found
WARNING:root:could not open file '/etc/apt/sources.list'

No command 'Defaults' found, did you mean:
Command 'defaults' from package 'gnustep-base-runtime' (universe)
Defaults: command not found
-su: /etc/sudoers: line 20: syntax error near unexpected token `('
-su: /etc/sudoers: line 20: `root       ALL=(ALL:ALL) ALL'
如何解决?有没有大神帮个忙告知一下,感激不尽!

yomun 发表于 2017-09-28 22:43:23 | 显示全部楼层
本帖最后由 yomun 于 2017-09-29 13:36 编辑

如果是想让户口免输入密码.. (当用 sudo)
创建新文件..

$ su

$ cd /etc/sudoers.d
$ gedit <UID>
<UID>   ALL=(ALL) NOPASSWD: ALL

$ chown root:root <UID>

$ chmod 644 <UID>

不需重启或登出, 立刻生效..

yomun 发表于 2017-09-28 22:36:52 | 显示全部楼层

/etc/sudoers 源码:

Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

root        ALL=(ALL:ALL) ALL
%admin ALL=(ALL) ALL
%sudo        ALL=(ALL:ALL) ALL

yomun 发表于 2017-09-28 22:40:20 | 显示全部楼层

/etc/sudoers 并不能用 source 指令来启用.

您需要登录后才可以回帖 登录

本版积分规则

快速回复 返回顶部 返回列表

分享到微信

打开微信,点击顶部的“╋”,
使用“扫一扫”将网页分享至微信。