1.创建组distro,其GID为2016
[root@localhost ~]# groupadd -g 2016 distro
2.创建用户mandriva,其ID号为1005;基本组为distro
[root@localhost ~]# useradd -u 1005 mandriva -g 2016
3.创建用户mageia,其ID号为1100,家目录为/home/linux;
[root@localhost linux]# useradd -d /home/linux/ -u 1100 mageia
4.给用户mageia添加密码,密码为mageedu;
[root@localhost ~]# passwd mageia
Changing password for user mageia.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
5.删除mandriva,但保留其家目录;
[root@localhost ~]# userdel mandriva
6.创建用户slackware,其id号为2002,基本组为distro,附加组peguin;
[root@localhost ~]# useradd -u 2002 -g distro -G peguin slackware
7.修改slackware的默认shell为/bin/tcsh;
usermod -s /bin/tcsh slackware
8.为用户slackware新增加附加组admins;
usermod -G admins,peguin slackware
原创文章,作者:469008940,如若转载,请注明出处:http://www.178linux.com/86258