5.2 创建用户和组

By admin, 15 一月, 2019

1. 添加用户useradd

useradd [选项] <用户名>

其中常用的一个选项是-m可以自动创建用户home目录。

2. 修改密码passwd

创建用户后可以通过password <用户名>向用户制定密码。

3. 修改用户信息usermod

可以修改用户所属群组等信息,具体使用方法通过-h参数查阅即可。

4. 删除用户userdel

5. 添加组groupadd

groupadd [选项] <组名>

6. 修改组信息groupmod

7. 删除组groupdel

8. 相关文件

以下文件和用户信息相关,添加修改用户会在下面文件留下记录,感兴趣的话可以看看文件内容。

/etc/group,/etc/passwd,/etc/shadow

 

9. 考纲描述

5.2 Creating Users and Groups

Weight: 2

Description: Creating users and groups on a Linux system.

Key Knowledge Areas:

  • User and group commands
  • User IDs

The following is a partial list of the used files, terms and utilities:

  • /etc/passwd, /etc/shadow, /etc/group, /etc/skel/
  • useradd, groupadd
  • passwd

 

下一节:5.3 管理文件权限和拥有者

返回目录

评论

Restricted HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。
验证码
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
请输入"Drupal10"