Linux Modify User home directory (reprint)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.