Hello. My name's Kate. I love Linux, WordPress - owned a WordPress dedicated design studio, a beginner entrepreneur who co-founded Asia software company. This is where i blog about Linux, WordPress, daily life and other interesting stuff
Status: -

You are on the Nineteen Labs » Change Default Home Directory for User in Centos article.

Change Default Home Directory for User in Centos

Everytime users created, it will keep per line inside /etc/passwd.
The line has the following characteristics:
1. It begins with the username.
2. There is an x for the password field indicating that the system is using shadow passwords.
3. A UID greater than 499 is created. (Under Red Hat Enterprise Linux/CentOS, UIDs and GIDs below 500 are reserved for system use.)
4. A GID greater than 499 is created.
5. The optional GECOS information is left blank.
6. The home directory
7. The default shell is set to /bin/bash.

Open /etc/passwd with VI :
#vi /etc/passwd

Find username that you want to change its default home directory, press i (for insert in VI) then retype a new home directory. DO NOT CHANGE OTHER INFORMATION, just home directory (e.g /home/username/). Then press wq! (for write and quit in VI)

You can set a home directory when you created user by adding -d to useradd , e.g useradd -d

Share : These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • SphereIt
  • BlinkList
  • Reddit
  • StumbleUpon

Receives One Response to “Change Default Home Directory for User in Centos”

Leave a Reply

This site powered : WordPress. Made with PC (sorry, MAC), Coffee and Tofu