Nathan Riley
asked on
Change a users Home Directory
I'm on CENTOS and trying to change an existing user's home directory. I tried usermod, but says that command is bad. Any other way?
usermod -d /home/userid userid
ASKER
I did that, but got this error bash: usermod: command not found. Do I need to do it from a certain location?
Other easy way is to edit the /etc/passwd file
Manually change the user and change its home directory
Manually change the user and change its home directory
Easy: As root edit /etc/passwd using texteditor and modify Field No 6.
Fields are separated by colon (:)
Entry loks like
username:x:uid:gid:Comment :/home/username:/bin/bash
Fields are separated by colon (:)
Entry loks like
username:x:uid:gid:Comment
You have to the root user to do so or you have to use sudo
ASKER
heh, tried that before and had some major issues after the edit, would like to do using usermod, I am logged in as root, but still getting the error: error bash: usermod: command not found
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You became user by doing
su
You should have done
su -
Just guessing because your path is not set for root user
su
You should have done
su -
Just guessing because your path is not set for root user