NotePublic/Software/Applications/Sudo/Sudo_授权普通账户.md
rick.chan 8b520b8451 修正高亮标签.
Signed-off-by: rick.chan <chenyang@autoai.com>
2020-05-20 16:18:39 +08:00

530 B

Sudo 授权普通账户

首先以 root 身份登陆系统。

检查 /bin/sudo 是否有 s 位权限

$ ll /bin/sudo
-rwsr-xr-x 1 root root

如果不存在则添加上:

chmod +s /bin/sudo

编辑 /etc/sudoers 文件

先增加写权限:

chmod +w /etc/sudoers

之后编辑该文件,在:

root ALL=(ALL) ALL

这行下面增加一行,格式为:

<system user name> ALL=(ALL) ALL

保存退出后关闭写权限:

chmod -w /etc/sudoers