标签:用户
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.
标签:用户
原文地址:http://limuzi.blog.51cto.com/11881816/1833622