How to rename or change user name in Linux


Please shareShare on Facebook23Share on Google+15Tweet about this on Twitter23Share on LinkedIn1Share on Reddit0Digg thisShare on StumbleUpon0Share on VKBuffer this page

Question : How  to  rename or  change user name in Linux?


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


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