For example, changing the uid and gid for mysql user daemon. May face MySQL directory not working or cant start the mysql services. Same applied to apache or whatever services daemon.
So, here the step can use to solve all the headache.
Existing zabbix user uid and gid from /etc/passwd
zabbix:x:1008:1008::/home/zabbix:/bin/bash
New uid and gid for zabbix is 300:300
1. Change the uid and gid:
groupmod -g 300 zabbix
usermod -u 300 -g 300 zabbix
2. Find all directory and change to new uid and gid:
find / -user 1008 -print0 | xargs -0 chown -h 300
find / -group 1008 -print0 | xargs -0 chgrp -h 300
That all.. job done.
p.s: Credit go to http://www.cyberciti.biz/faq/howto-change-rename-user-name-id/