首页 > 其他 > 详细

0801随堂练习

时间:2016-08-02 22:30:31      阅读:228      评论:0      收藏:0      [点我收藏+]

1、创建用户gentoo,附加组为bin和root,默认shell为/bin/csh,注释信息为"Gentoo Distribution"


  [root@localhost ~]# useradd -G bin,root -s /bin/csh -c "Gentoo Distribution" gentoo
  [root@localhost ~]# getent passwd gentoo
  gentoo:x:501:501:Gentoo Distribution:/home/gentoo:/bin/csh



2、创建下面的用户、组和组成员关系
  名字为admins 的组
  用户natasha,使用admins 作为附属组
  用户harry,也使用admins 作为附属组
  用户sarah,不可交互登录系统, 且不是admins 的成员,
  natasha, harry, sarah密码都是centos


  [root@localhost ~]# groupadd admins
  [root@localhost ~]# useradd -G admins natasha
  [root@localhost ~]# useradd -G admins harry
  [root@localhost ~]# useradd -s /bin/nologin sarah
  [root@localhost ~]# echo "centos" | passwd --stdin natasha
  Changing password for user natasha.
  passwd: all authentication tokens updated successfully.
  [root@localhost ~]# echo "centos" | passwd --stdin harry
  Changing password for user harry.
  passwd: all authentication tokens updated successfully.
  [root@localhost ~]# echo "centos" | passwd --stdin sarah
  Changing password for user sarah.
  passwd: all authentication tokens updated successfully.

0801随堂练习

原文:http://limuzi.blog.51cto.com/11881816/1833622

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!