From 4e74c30d138216f8ea669a8aa5cecf26895d5bb7 Mon Sep 17 00:00:00 2001 From: "ithink.chan" Date: Thu, 25 Jul 2019 10:50:03 +0800 Subject: [PATCH] =?UTF-8?q?Linux=20=E6=B7=BB=E5=8A=A0/=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=92=8C=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ithink.chan --- .../Linux/Linux_添加_删除_用户和组.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Software/OperatingSystem/Linux/Linux_添加_删除_用户和组.md diff --git a/Software/OperatingSystem/Linux/Linux_添加_删除_用户和组.md b/Software/OperatingSystem/Linux/Linux_添加_删除_用户和组.md new file mode 100644 index 0000000..18c1635 --- /dev/null +++ b/Software/OperatingSystem/Linux/Linux_添加_删除_用户和组.md @@ -0,0 +1,24 @@ +# Linux 添加/删除用户和组 + +使用以下命令添加用户和组: + +```sh +groupadd +useradd -d -g +``` + +useradd 和 groupadd 命令使用比较复杂,可使用 adduser 和 addgroup 命令简化操作: + +```sh +addgroup +adduser +``` + +adduser 和 addgroup 提供了一个脚本,根据与用户的交互信息调用更底层的 useradd 和 groupadd 命令执行实际操作。 + +使用以下命令可删除用户和组: + +```sh +userdel -r +groupdel +```