linux用户与组,该怎么处理

linux用户与组
useradd user
groupadd users
gpasswd -a user users
现在我想在user下建目录或者是文件时,同时它的文件和目录所属的组不是user自己而是users!
请问一下这样我该怎么做?


groupdel user


[root@RHEL6B ~]# useradd user3 -g users -G users
[root@RHEL6B ~]# grep user3 /etc/passwd
user3:x:504:100::/home/user3:/bin/bash
[root@RHEL6B ~]# grep user3 /etc/group
users:x:100:user3
[root@RHEL6B ~]# passwd user3

[user3@RHEL6B ~]$ ls -al
总用量 36
drwx—— 4 user3 users 4096 12月 5 14:55 .
drwxr-xr-x. 7 root root 4096 12月 5 14:55 ..
-rw-r–r– 1 user3 users 18 6月 22 2010 .bash_logout
-rw-r–r– 1 user3 users 176 6月 22 2010 .bash_profile
-rw-r–r– 1 user3 users 124 6月 22 2010 .bashrc
-rw-r–r– 1 user3 users 500 1月 24 2007 .emacs
drwxr-xr-x 2 user3 users 4096 7月 14 2010 .gnome2
drwxr-xr-x 4 user3 users 4096 12月 2 01:37 .mozilla
-rw——- 1 user3 users 52 12月 5 14:55 .Xauthority
[user3@RHEL6B ~]$ mkdir test
[user3@RHEL6B ~]$ touch test1.txt
[user3@RHEL6B ~]$ ls -l|grep test
drwxr-xr-x 2 user3 users 4096 12月 5 14:55 test
-rw-r–r– 1 user3 users 0 12月 5 14:56 test1.txt

linux用户与组,该怎么处理

相关文章:

你感兴趣的文章:

标签云: