设置带sgid的目录权限
[root@server0 home]# chmod g+s admins/ #所属组与上级文件夹一样
[root@server0 home]# ll
total20
drwx------.5 a a 4096 Oct 1 18:50 a
drwx------.5 abc abc 4096 Oct 1 16:59 abc
drwxrws---.2 root adminuser 16 Oct 1 19:39 admins
[root@server0 home]# cdadmins/
[root@server0 admins]# touch bbbb
[root@server0 admins]# ll
total0
-rw-r--r--.1 root adminuser 0 Oct 1 19:47 bbbb
[root@server0 admins]#
创建指定uid或gid用户
[root@desktop0 ~]#useradd alex -u 3456
[root@desktop0 ~]# echo"glegunge" | passwd --stdin alex
Changingpassword for user alex.
passwd:all authentication tokens updated successfully.
[root@desktop0 ~]#
转载于:https://blog.51cto.com/4708948/1701862