红帽RHCE考试上午-RHCSA(RH134)

servera.example.com 任务

4.创建指定的用户账户

  • useradd 命令可以创建新的Linux用户同时可以指定用户所属组
  • useradd创建用户时。如果同名组不存在,则会同时创建同名用户组

任务要求

  • 创建下列用户、组和组成员资格:
  1. 名为sysmgrs 的组
  2. 用户natasha ,作为次要组从属于sysmgrs
  3. 用户harry ,作为次要组还从属于sysmgrs
  4. 用户sarah ,无权访问系统上的交互式shell 且不是sysmgrs 的成员
  5. natasha 、harry 和sarah 的密码应当都是redhat

完成步骤

groupadd sysmgrs
useradd -G sysmgrs natasha
useradd -G sysmgrs harry
useradd -s /sbin/nologin sarah
for i in natasha harry sarah; do echo redhat | passwd --stdin $i; done

考察的知识点

  • useradd常用参数
|Options| Discretion|
|:--|:--|
| -b, --base-dir BASE_DIR       | base directory for the home directory of the new account
| -c, --comment COMMENT         | GECOS field of the new account
| -d, --home-dir HOME_DIR       | home directory of the new account
| -D, --defaults                | print or change default useradd configuration
| -e, --expiredate EXPIRE_DATE  | expiration date of the new account
| -f, --inactive INACTIVE       | password inactivity period of the new account
| -g, --gid GROUP               | name or ID of the primary group of the new account
| -G, --groups GROUPS           | list of supplementary groups of the new account
| -h, --help                    | display this help message and exit
| -k, --skel SKEL_DIR           | use this alternative skeleton directory
| -K, --key KEY=VALUE           | override /etc/login.defs defaults
| -l, --no-log-init             | do not add the user to the lastlog and faillog databases
| -m, --create-home             | create the user's home directory
| -M, --no-create-home          | do not create the user's home directory
| -N, --no-user-group           | do not create a group with the same name as the user
| -o, --non-unique              | allow to create users with duplicate (non-unique) UID
| -p, --password PASSWORD       | encrypted password of the new account
| -r, --system                  | create a system account
| -R, --root CHROOT_DIR         | directory to chroot into
| -P, --prefix PREFIX_DIR       | prefix directory where are located the /etc/* files
| -s, --shell SHELL             | login shell of the new account
| -u, --uid UID                 | user ID of the new account
| -U, --user-group              | create a group with the same name as the user
| -Z, --selinux-user SEUSER     | use a specific SEUSER for the SELinux user mapping

RHCSA-A4.创建指定的用户账户相关推荐

  1. 在计算机上创建一个本地用户账户,在工作组中,默认时每台Windows计算机的( )能够在本地计算机的SAM数据库中创建并管理本地用户账户。...

    在工作组中,默认时每台Windows计算机的( )能够在本地计算机的SAM数据库中创建并管理本地用户账户. 更多相关问题 Working with the foreigners ____ me ___ ...

  2. 在计算机上创建一个本地用户账户,多种方法教你创建和删除Win10本地账户?

    Win10系统如何创建和删除本地账户?现在使用Win10系统的朋友越来越多了,有位Windows10用户反映自己因为刚刚升级系统,所以对系统中的很多操作都很陌生.尤其是对Win10系统中添加和删除用户 ...

  3. 计算机怎么新建用户名和密码,win10怎么新建用户账户?win10系统如何创建新用户?(图文)...

    今天教大家如何在win10系统里创建新用户.众所周知,windows的系统都是可以同时创建多个用户账户的,win10自然也不例外.不过win10相对于之前的系统版本,在菜单界面上做了不少的改动,导致很 ...

  4. 计算机用户账户添加,windows添加用户账户

    windows server 2003, "我的电脑"->右键"管理" "本地用户和组"->右键"用户"-& ...

  5. win8 必须重新启动计算机才能关闭用户账户控制,windows8中怎么关闭用户账户控制(UAC)仅针对单个用户...

    1.登陆 Windows 8 Metro 界面,单击左下角桌面图标,如下图: 2.登录桌面后,使用组合热键"Windows + X键"调出快捷菜单(如果桌面已经调出控制面板图标,直 ...

  6. 如何在Windows 8 中关闭用户账户控制(UAC)

    如何在Windows 8 中关闭用户账户控制(UAC) 适用范围: Windows 8 操作步骤: 1.登陆 Windows 8 Metro 界面,单击左下角桌面图标,如下图: 2.登录桌面后,使用组 ...

  7. win8 必须重新启动计算机才能关闭用户账户控制,Win8如何关闭用户账户控制(UAC)...

    Win8关闭用户账户控制(UAC)的方法如下: 1.登陆Windows 8 Metro界面,单击左下角桌面图标. 2.登录桌面后,使用组合热键"Windows + X键"调出快捷菜 ...

  8. Linux下创建用于并指定该用户的主目录和相关权限

    实习期间,由于公司的需要,创建用户并指定该用户的主目录,也就是账户一登入,就直接到该目录下来,当时很傻的以为是useradd -g -G -p -d什么的,一顿试啊,结果还是试出来了,因为之前在培训的 ...

  9. oracle之创建和管理数据库用户账户

    创建和管理数据库用户账户 sys 查看数据库里有多少用户? select username from dba_users; 9.1.1用户的缺省表空间 每个用户账户都可以指定默认的表空间,用户创建的任 ...

最新文章

  1. 将数据库的操作代码从servlet中剥离,封装到DAO中
  2. select函数测试
  3. 从三个数组中选择满足条件的三个数
  4. 创业冲突的五种解决方法是_当创业合伙人发生冲突时,最好的解决办法看这5招...
  5. Swagger使用————接口参数注解的使用缺陷
  6. 美国海关大量人脸数据泄露,暗网可以免费下载,锅被甩给外包公司
  7. 【Cocos2d-x游戏开发】解决Cocos2d-x中文乱码的三种方法
  8. python自动化办公教程百度云-用Python自动办公,做职场高手,16章完整版百度云盘...
  9. 软件推荐——Modbus调试工具Modbus Poll与Modbus Slave
  10. 一些微信小程序demo源码
  11. flex builder 4.6破解
  12. Ehcache开源解读
  13. deepin 更新企业微信最新版本方法
  14. 教你怎么解决Linux依赖包第一篇:pkgs.org资源网下载
  15. 阿里云云平台,物联网可视化web界面简单教程
  16. 大数据助力创建数字化智慧城市解决方案
  17. 微信小程序在线考试系统 毕业设计(6)会员首页
  18. Howler 音频资源跨域提示html5
  19. 详细解读Windows8.1 Update中的WIMBoot新特性
  20. 面试题 01.03. URL化 + 重新排列字符串

热门文章

  1. 帕金森病患者起居生活需要注意什么
  2. linux wget返回值_Linux中curl命令和wget命令的使用介绍与比较
  3. 传统PC和云桌面的五大差异
  4. RStudio无法成功下载stringi包
  5. Kafka 再均衡监听器示例
  6. 关闭Windows Ctrl+Alt+Delete来解锁睡眠
  7. 数字冰雹创始人邓潇专访:2017大数据可视化的关键技术及行业应用
  8. POJ2255 java
  9. 安装框架断路器要注意什么?该如何选择断路器?
  10. 识别在线视频中的歌曲并下载音乐