Editor for /etc/sudoer

新建用户,添加至sudo的若干步骤

1
usermod -aG root username

这时候,我在debian上依旧不行 (这是因为/etc/sudoer的配置中,并没有指定root用户组中的成员都可以使用sudo)

1
adduser useradd root

还是没用,选择直接编辑/etc/sudoer, 注意到这个文件的权限 image.png 通常使用sudoedit进行编辑, 这个时候如果出现语法错误,会非常蛋疼,查了资料后发现, visudo是个更好的选择,visudo不会在/etc/sudoer语法错误时拒绝编辑该文件,还会在保存后语法错误时提示重新编辑 image.png

Licensed under CC BY-NC-SA 4.0
Built with Hugo
Theme Stack designed by Jimmy