From 8e2055c3352067a1b7638e583de6507b8b55b0b1 Mon Sep 17 00:00:00 2001 From: "ithink.chan" Date: Fri, 11 Oct 2019 10:04:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=20Sudo=20=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E6=99=AE=E9=80=9A=E8=B4=A6=E6=88=B7.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ithink.chan --- .../Applications/Sudo/Sudo_授权普通账户.md | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Software/Applications/Sudo/Sudo_授权普通账户.md diff --git a/Software/Applications/Sudo/Sudo_授权普通账户.md b/Software/Applications/Sudo/Sudo_授权普通账户.md new file mode 100644 index 0000000..addb9cd --- /dev/null +++ b/Software/Applications/Sudo/Sudo_授权普通账户.md @@ -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 + ALL=(ALL) ALL +``` + +保存退出后关闭写权限: + +```sh +chmod -w /etc/sudoers +```