Usermod Command--linux command application of large dictionary 729 commands interpretation

Source: Internet
Author: User

The content originates from the people's post and Telecommunications press "Linux command Application big dictionary"

tell 729 commands, 1935 examples

Learn about the Linux system's reference books, desk book, encountered the command or command not understand the options can be found

Strive to publish content every day


airfish2000 "blog, More commands to view blogs:

http://airfish2000.blog.51cto.com/10829608/1887965


Usermod Command

use the usermod command to modify user account properties, such as changing the user's Shell type, the group to which it belongs, the lifetime of the user's password , and the user's login name.

Command syntax:

usermod [ options ] [ user name ]

The meanings of the options in the command are as follows is shown.

table usermod command options meaning

Options

Meaning

-G < secondary Group name >

Modify the secondary group to which the user belongs (additional group)

-L < new sign-in name >

Modify user account name

-L

Lock the user password to invalidate the password

-S <shell type >

After you modify the user login, use the Shell. if not, the system will use the system preset Shell

-U

Unlock password

-U < user uid>

Modify User Uid

-C < username Full name >

Modify the user name of the user account

-d < master directory ;

Modify the home directory when the user logs in, If you specify the -m

-E < expiry date >

Modify the validity period of the account, plus the user account stop date, the date format is Mm/dd/yy

-F < expiry date >

Modify how many days after the password expires the account is closed

-G < main group name >

Modify the primary group to which the user belongs, The cluster name must already exist

-O

allows the use of duplicate Uid

-M

Move the contents of the home directory to a new location

Example : Modify the user Zhangsan 's home directory to /HOME/KKK, and manually create the/HOME/KKK directory.

[Email protected]~]# usermod-d/home/kkk Zhangsan

[[Email protected]~]# mkdir/home/kkk

You must use the mkdir command to create the/HOME/KKK directory so that the user Zhangsan can use the home directory

Example : Modify the user Wangwu 's home directory to /home/opop, and create the/home/opop directory automatically.

[Email protected]~]# usermod-d/home/opop-m Wangwu

Example : Modify user Wangwu 's login name to Zhaoliu.

[Email protected]~]# usermod-l Zhaoliu Wangwu

Example : User name modified by user Zhangsan is all called Zhang San.

[Email protected]~]# usermod-c Zhang San zhangsan

Example : Modify User Zhangsan the account is disabled after the password expires .

[Email protected]~]# usermod-f Zhangsan

Example : Modify The primary group that the user Zhangsan belongs to as root.

[Email protected]~]# usermod-g Root Zhangsan

Example : Locks the user Zhangsan password to invalidate the password.

[Email protected]~]# usermod-l Zhangsan

Example : Unlock user Zhangsan password.

[Email protected]~]# usermod-u Zhangsan

Example : The expiration date of the modified user Zhangsan account is 2028 year .

[Email protected] ~]# usermod-e 12/12/2028 Zhangsan

Example : The Shell type that modifies user Zhangsan is /bin/ksh.

[Email protected] ~]# usermod-s/bin/ksh Zhangsan


This article is from the "airfish2000" blog, make sure to keep this source http://airfish2000.blog.51cto.com/10829608/1887965

Usermod Command--linux command application of large dictionary 729 commands interpretation

Related Article

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.