Linux will keep per line inside /etc/passwd after Linux create user.
The line have following characteristics:
1. It begins with username.
2. There is an x for 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 to change its default home directory, press i (for insert in VI) before you’ll type a new home directory. DO NOT CHANGE OTHER INFORMATION, only home directory (e.g /home/username/).
Press wq! (for write and quit in VI). Enter.
You can set a home directory for a user by adding -d to useradd , e.g
useradd -d
Related posts:





You forgot to press “Esc” (important) before typing “:wq!” (with a colon)