From 1f6d4b6d4f8a68b3eabd5eef4d45d94c55fcbb06 Mon Sep 17 00:00:00 2001 From: "rick.chan" Date: Tue, 12 May 2020 10:28:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A9=E5=B1=95=E7=94=A8=E6=88=B7=E5=92=8C?= =?UTF-8?q?=E7=BB=84=E6=93=8D=E4=BD=9C=E6=8C=87=E4=BB=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rick.chan --- .../Modules/Account/Linux_用户和组操作.md | 58 ++++++++++++++++++- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/Software/System/Linux/Modules/Account/Linux_用户和组操作.md b/Software/System/Linux/Modules/Account/Linux_用户和组操作.md index 38f211e..19304d2 100644 --- a/Software/System/Linux/Modules/Account/Linux_用户和组操作.md +++ b/Software/System/Linux/Modules/Account/Linux_用户和组操作.md @@ -25,14 +25,66 @@ userdel -r groupdel ``` -## 查看用户所属组 +## 组操作 + +### 将用户添加到组 + +```sh +gpasswd --add +``` + +### 从组中删除用户 + +```sh +gpasswd -d +``` + +### 查看用户所属组 ```sh groups ``` -## 将用户添加到组 +### 修改组名 ```sh -gpasswd --add +groupmod -n +``` + +## 用户操作 + +### 为用户设置密码 + +```sh +passwd +``` + +### 显示用户信息 + +```sh +id +``` + +### 修改用户名 + +```sh +usermod -l +``` + +### 修改用户 Home 目录 + +```sh +usermod -d +``` + +### 修改用户 ID + +```sh +usermod -u +``` + +### 更改用户信息 + +```sh +chfn ```