Change user id/group id in linux
mouse 18 · person cloud · link
Last update
2019-10-30
2019
10-30
«change uid/gid for a user»
1
2
3
4
5
6
7
8
9
id foo # uid=1000, gid=2000

# change ids to 5000.6000
usermod  -u 5000 foo
groupmod -g 6000 foo

# fix old files settings
find / -user  1000 -exec chown -h foo {} \;
find / -group 2000 -exec chgrp -h foo {} \;

Source: cyberciti.biz