Ya Right hgsolari
There is two different things you expected
1. To change Owner of group of Folder
2. To change Primary group of User
for 1.
[root@localhost xx]# usermod -g dba test1
[root@localhost xx]# ls -al
total 36
drwx------ 2 test1 test1 4096 Nov 15 00:05 .
drwxr-xr-x 22 root root 4096 Nov 15 00:05 ..
---->
[root@localhost xx]# ls -al
total 36
drwx------ 2 test1 test1 4096 Nov 15 00:05 .
drwxr-xr-x 22 root root 4096 Nov 15 00:05 ..
[root@localhost xx]# chown -R test1:dba test1
for 2
[root@localhost xx]# usermod -g dba test1
Here -g used for to add 'dba' as secondary group in user test1
[root@localhost xx]# usermod -G dba test1
[root@localhost xx]# cat /etc/group | grep -i test1
[root@localhost xx]# mkdir /home/test1/test
[root@localhost xx]# ls -l /home/test1/.
drwxr-xr-x xx test1 dba xxxx xxx xx xx:xx test
Quote:
Originally Posted by hgsolari
Hello
I find your question a little bit confusing.
usermod modifies the group of the user, but then you check the files of the user and, certainly, the ownership did not change as you have only modified /etc/passwd in essence.
Just complete your work
chown -R test1:dba /home/test1
the -R means recursive.
Hernan
|