Changing username and home/user directory
I have a Linux based application but i wanted to change the home /user directory from dayo@localhost to abc@localhost ALSO i wanted to change the username too.
How do i do this . Thanks |
Hi, welcome to LQ.
As root: Code:
usermod -d /home/abc -m -l abc dayo PS You don't even have to create the /home/abc directory or to move the files from /home/dayo to /home/abc, "usermod" will do it for you. |
Thanks Didier, however, i could not get it done anyway. When i applied the code at [root@localhost /]# usermod -d /home/abc -m -l abc dayo
THE RESPONSE IS "bash: usermod: command not found" Do i have to edit the names in etc/passwd , etc/group and etc/shadow ,etc/gshadow. or what? I just want to have a change of my name from [dayo@localhost~]$ to [abc@localhost~]$. and also change my login username from dayo to abc |
AFAIK the "usermod" command is available for CentOS. Check the CentOS documentation or make a Google search for "centos usermod"
|
Certainly on Centos6 its /usr/sbin/usermod & probably the same in v5.
http://www.linuxtopia.org/online_boo...users-cmd-line http://www.linuxtopia.org/online_boo...ers-tools.html Definitely need to be root. Possibly your root user's $PATH does not contain that dir? |
Or maybe you became root with "su" instead of "su -"?
In any case typing the full path of the command as root, i.e. Code:
/usr/sbin/usermod -d /home/abc -m -l abc dayo |
All times are GMT -5. The time now is 02:37 AM. |