First: Modify the/etc/passwd file
Second: usermod command
Detailed description is as follows:
The first method:
vi /etc/passwd
Find the user you want to modify the lines, modify it. This law is very violent, it is recommended to use caution.
The second type: Usermod
usermod-d/usr/newfolder-u UID Username
You must take the UID after-u, then the username.
Attached: usermod Detailed parameters
Syntax: Usermod [-lu][-c < remarks >][-d < login directory >][-e < expiration >][-F < buffer days >][-g < group >][-g < group >][-l &L t; account name >][-s][-u] [user account]
Additional note: Usermod can be used to modify the user account settings.
parameters:
-c< remarks > Modify the Notes text of the user account.
-d Login directory > Modify the directory in which users log in.
-e< Validity period > Modify the expiration date of the account.
-f< buffer days > Modify the number of days after the password expires to close the account.
-g< Group > Modify the group to which the user belongs.
-g< Group > Modify the additional group to which the user belongs.
-l< account name > Modify user account name.
-l Lock the user password to invalidate the password.
-s Modify the shell used by the user when they log in.
-u modify the user ID.
-u unlock the password.
UID View
ID User Name
Example: Modifying the Oracle User's home directory to/u01/app/oracle
ID Oracleuid=501(Oracle) gid=501Groups=501501 Oraclesu - Oracle-bash-4.1pwd/u01/app/oracle
--Modification success
Source: http://blog.csdn.net/xujinyang/article/details/8894001
From for notes (Wiz)
Linux Modify User home directory (reprint)