补充 Sudo 授权普通账户.

Signed-off-by: ithink.chan <chenyang@autoai.com>
This commit is contained in:
ithink.chan 2019-10-11 10:04:28 +08:00
parent 628eb75e62
commit 8e2055c335
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
# Sudo 授权普通账户
以 root 身份登陆系统.
## 检查 /bin/sudo 是否有s位权限
```sh
ll /bin/sudo
-rwsr-xr-x 1 root root
```
如果不存在则添加上:
```sh
chmod +s /bin/sudo
```
## 编辑 /etc/sudoers 文件
先增加写权限:
```sh
chmod +w /etc/sudoers
```
之后编辑该文件,在:
```sh
root ALL=(ALL) ALL
```
这行下面增加一行,格式为:
```sh
<system user name> ALL=(ALL) ALL
```
保存退出后关闭写权限:
```sh
chmod -w /etc/sudoers
```