Linux Study notes second lesson of the third week (February 6)

Source: Internet
Author: User

3.4 usermod Command


Change user Properties Usermod,

Change uid, command is #usermod-u number;

Change GID, command for #usermod-g number;

change The user home directory, the command is #usermod-d number;

change The user shell, the command is #usermod-s number;

Set the user expansion group, the command is #USERADD-G Group name ", group name";

View aming user Uid,gid, expansion group, #id aming;

Lock user cannot use, command for #usermod-l aming;

Unlock user, command for #usermod-u aming;


3.5 User Password Management


Modify the user password, the command is #passwd user name;

View user Password profile, command for the first 10 lines #head/etc/shadow or 10 lines #tail/etc/shadow;

Lock user cannot use, command is #passwd-l user name; password profile password bit plus two exclamation mark;

Modify the user password, clear text display password, command for #passwd--stdin User5;

Modify user password,#echo "111222" |passwd--stdin user5;

#echo-E implements some special usages, \ n newline character, \ t is tab, command is #echo-e "123\nsss";

Modify the user password, a command to enter the password two times, the command for #echo "1231111\n1231111" |passwd User3;


3.6 mkpasswd Command


Randomly generate a string as a password, command mkpasswd,make password;

installation Command MKPASSWD package #yum install-y expect;

Use method, command for #mkpasswd;

-l Specifies the length, the command is #mkpasswd-l number;

-S special symbol number, command for #mkpasswd-s number;


Linux Study notes second lesson of the third week (February 6)

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.