Question : How to rename or change user name in Linux?
Answer:
killall -u old id old usermod -l new old groupmod -n new old usermod -d /home/new -m new usermod -c “New Real Name” new id new
Example:
kill -u pirat9
#id pirat9 uid=1000(pirat9) gid=1000(pirat9) groups=1000(pirat9),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),127(sambashare)
# id blanco uid=1001(blanco) gid=1001(blanco) groups=1001(blanco) pirat9@pirat9 ~ $
usermod -l blanco pirat9
groupmod -n blanco pirat9
usermod -d /home/blanco -m blanco
usermod -c "James Bond" blanco
id blanco
Done