Skip to content

Commit

Permalink
Update chage.md (#427)
Browse files Browse the repository at this point in the history
* Update chage.md

* 更新useradd用法
  • Loading branch information
lutixiaya committed Oct 12, 2022
1 parent 4aaa543 commit 833b43d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion command/chage.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ chage [选项] 用户名
-w:用户密码到期前,提前收到警告信息的天数。
-E:帐号到期的日期。过了这天,此帐号将不可用。
-d:上一次更改的日期。
-i:停滞时期。如果一个密码已过期这些天,那么此帐号将不可用。
-I:停滞时期。如果一个密码已过期这些天,那么此帐号将不可用。
-l:例出当前的设置。由非特权用户来确定他们的密码或帐号何时过期。
```

Expand Down
15 changes: 15 additions & 0 deletions command/useradd.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,19 @@ useradd caojh -u 544

需要说明的是,设定ID值时尽量要大于500,以免冲突。因为Linux安装后会建立一些特殊用户,一般0到499之间的值留给bin、mail这样的系统账号。

新建一个普通用户:

```shell
useradd lutixia
```

新建一个系统用户,系统用户一般用于管理服务,无需登录,所以分配nologin,限制其登录系统:
```shell
useradd -r -s /sbin/nologin mq
```

修改创建用户的默认参数,设置密码过期后到永久禁用的不活动时间为30天:
```shell
useradd -D -f 30
```

0 comments on commit 833b43d

Please sign in to comment.