1832619 Members
2879 Online
110043 Solutions
New Discussion

Change gid for a group

 
SOLVED
Go to solution
Cliff Lim Kok Hwee
Regular Advisor

Change gid for a group

Gd Day Forum,

I need to change the gid for a group name groupA from 779 to 5000.

This was performed.

vi /etc/group and change the gid
vi /etc/passwd and change the gid for users belonging to groupA

The following user belong to the groupA:
userA, userB

cd /home
chgrp -R groupA userA
chgrp -R groupB userB

Query:

- Did I miss out any other steps?

- It should not have any impact to /etc/shadow file?

Thanks/cliff

3 REPLIES 3
Alexander Chuzhoy
Honored Contributor
Solution

Re: Change gid for a group

Hey,
Of course there are utilities:
usermod -g
to change user's group

groupmod -g
to change group's gid

there's no need to edit /etc/shadow

Amit Agarwal_1
Trusted Contributor

Re: Change gid for a group

What about the files that belongs to these groups. You might like to search them and change the group id forcibly.

$ find / -group 5000 -exec chgrp 779 {] \;

-Amit
Gopi Sekar
Honored Contributor

Re: Change gid for a group


u have done it perfectly. but as the other person mentioned, it is always better to use the application which does this.

Gopi
Never Never Never Giveup