[CentOS] UID/GID migration vom C6 to C8

Mon Nov 15 13:05:22 UTC 2021
Thomas <thomas at plant.systems>


We have to migrate an old Centos 6 to Centos 8. C6 has UID/GID starting 
at number 500.
I the Users should possibily keep the existing UID/GID as on the old system.

I changed on the Centos 8 system, in /etc/login.defs, the lines 

# Min/max values for automatic uid selection in useradd
UID_MIN                   500
UID_MAX                 60000
# System accounts
SYS_UID_MIN               201
SYS_UID_MAX               499

# Min/max values for automatic gid selection in groupadd
GID_MIN                   500
GID_MAX                 60000
# System accounts
SYS_GID_MIN               201
SYS_GID_MAX               499

and extracted all users and groups with UID/GID greater than 499 from 
the old system and inserted in the corresponding files 
(passwd/groups/shadows) on the new system.

So wanted to ask if this is a valid thing to do? Especially regarding 
security of the new system. Can it create problems in the future 
(updates etc.)?
It is a simple LAMP server.