I am tasked with reassigning a static group id (gid) to an existing group name that exists on multiple Linux servers.
E.g. the group name foo
currently exists on multiple servers, but with different gids:
$ ssh server-1
$ getent group foo
foo:x:998:user1,user2
$ ssh server-2
$ getent group foo
foo:x:999:user2,user3
...given the above, my task would be to assign a new, unique gid to the group name foo
on server-1 and server-2.
I've found the following articles that describe changing an existing GID:
- https://www.thegeekdiary.com/how-to-correctly-change-the-uid-and-gid-of-a-user-group-in-linux/
- Change gid of a specific group
Question: how can I determine a "safe" number to use as the new gid?
E.g. what is a clean/efficient/correct way to determine that the new gid I choose isn't already used on any of the PCs where this change needs to be applied?
Please also advise if there are other factors/considerations on picking a good/available/safe gid.