Common commands for Linux users and management classes

Source: Internet
Author: User
Tags echo command

1. List the user name of all the users who have been waiting on the system, note: The same user login more than once, only once can be displayed.
650) this.width=650, "height=", "src=" http://b264.photo.store.qq.com/psb?/V14ApF1036yr41/ dpcbgawm2u.r3jd1lijpk5z.smv7p7djywf*3s.poey!/b/dagbaaaaaaaa&bo=dgjcaaaaaaafag0! "width=" 526 "style=" vertical-align:top; "alt=" dagbaaaaaaaa&bo=dgjcaaaaaaafag0! "/>

2 , remove information about the user who last logged on to the current system
650) this.width=650; "height=" "src=" B198.photo.store.qq.com/psb?/v14apf1036yr41/huajfsgpe8ks2xmgfrbeedadv07eyon8c8ct7j8vtj4!/b/dmyaaaaaaaaa&bo =lgfbaaaaaaafao8! "width=" 406 "style=" vertical-align:top; "alt=" dmyaaaaaaaaa&bo=lgfbaaaaaaafao8! "/> 

3 , take out the current system on the user as its default shell Most of the shell

4 /etc/passwd The third field in the largest value after 10 Span style= "font-family: ' The song Body '; Each user's information is changed to uppercase and saved to /tmp/maxusers.txt

5 , remove the current host's Ip address, tip: Slice the ifconfig command.
 650) this.width=650; "height=" 183 "src=" http://b199.photo.store.qq.com/psb?/V14ApF1036yr41/ quwxugm2u8d9ufur85fyg4eecrjrqkwlhbfcboart1y!/b/dmcaaaaaaaaa&bo=1ak3aaaaaaafaei! "width=" 724 "style=" vertical-align:top; "alt=" dmcaaaaaaaaa&bo=1ak3aaaaaaafaei! "/>

6 , take out /etc/ directory all under . Com 650) this.width=650; "height=" 640 "src=" http://b200.photo.store.qq.com/psb?/V14ApF1036yr41/ einmm2fcmhhjqjcqfn59j9dxxph9luotyym0ymx0ds4!/b/dmgaaaaaaaaa&bo=6wkaagaaaaafaeg! "width=" 747 "style=" vertical-align:top; "alt=" dmgaaaaaaaaa&bo=6wkaagaaaaafaeg! "/> 

7 , display /var 650) this.width=650, "height=", "src=" http://b200.photo.store.qq.com/psb?/v14apf1036yr41/ewvh5ojld* Qwhi3sish7lsxwyy.tr83j34ghzsnxwlm!/b/dmgaaaaaaaaa&bo=gge7aaaaaaafajs! "width=" 386 "style=" vertical-align:top ; "alt=" dmgaaaaaaaaa&bo=gge7aaaaaaafajs! "/> 

8 , take out /etc/group The third field in the file has the lowest value 10 Span style= "font-family: ' The song Body '; > The name of the group.
 650) this.width=650; "height=" 248 "src=" http://b259.photo.store.qq.com/psb?/V14ApF1036yr41/ P6axyu7iarnr6kd27q2s5y3dd2ugoau3paycyhcfrko!/b/dambaaaaaaaa&bo=kwl4aaaaaaafaeo! "width=" 659 "style=" vertical-align:top; "alt=" dambaaaaaaaa&bo=kwl4aaaaaaafaeo! "/>

9 /etc/fstab and /etc/issue  650) this.width=650; "height=" 289 "src=" http://b264.photo.store.qq.com/psb?/V14ApF1036yr41/ ix5ezdf8ygllnolque9rtq9wslfgxzn7flj9vedtgv0!/b/dagbaaaaaaaa&bo=2aihaqaaaaafank! "width=" 728 "style=" vertical-align:top; "alt=" dagbaaaaaaaa&bo=2aihaqaaaaafank! "/>

10     (1), create group distro, its GID is 2016; 
650) this.width=650; height= "src=" HTTP://B262.PHOTO.STORE.QQ.COM/PSB ?/v14apf1036yr41/finpwiljsxiy8v4ubujdxrnvs1ijf7zlwe0d49kae*c!/b/daybaaaaaaaa&bo=hqexaaaaaaafajy! "Width=" 389 "style=" vertical-align:top; "alt=" daybaaaaaaaa&bo=hqexaaaaaaafajy! "/> 

(2), create user Mandriva, whose ID number is 1005; basic group is distro;
650) this.width=650; "height=" src= "http://b198.photo.store.qq.com/psb?/v14apf1036yr41/*pmc8kk.rr5mnsmktp870* uwuwmoogomfcq9gjv8fci!/b/dmyaaaaaaaaa&bo=8wewaaaaaaafaoe! "width=" 499 "style=" vertical-align:top; "alt=" dmyaaaaaaaaa&bo=8wewaaaaaaafaoe! "/>

(3), create user Mageia, whose ID number is 1100, home directory is/home/linux;
650) this.width=650, "height=", "src=" http://b262.photo.store.qq.com/psb?/v14apf1036yr41/raxkcdocg* w8spmelopfhyueyrd3znmxzbg.m.uanv4!/b/daybaaaaaaaa&bo=egiyaaaaaaafaae! "width=" 530 "style=" vertical-align:top ; "alt=" daybaaaaaaaa&bo=egiyaaaaaaafaae! "/>

(4), to the user mageia add password, password for mageedu;
650) this.width=650; "height=" src= "http://b198.photo.store.qq.com/psb?/V14ApF1036yr41/ erkhyosqk2vk5jezjtoxqgxw*bfffnhjqx.p9l0tghu!/b/dmyaaaaaaaaa&bo=fajxaaaaaaafagi! "width=" 532 "style=" vertical-align:top; "alt=" dmyaaaaaaaaa&bo=fajxaaaaaaafagi! "/>

(5), delete Mandriva, but retain their home directory;
650) this.width=650; "height=" "src=" http://b198.photo.store.qq.com/psb?/V14ApF1036yr41/ xqtzamizrtpt.0abygpxu9grzo.sdcswzewp4yai4vq!/b/dmyaaaaaaaaa&bo=kqexaaaaaaafaii! "width=" 401 "style=" vertical-align:top; "alt=" dmyaaaaaaaaa&bo=kqexaaaaaaafaii! "/>

< Span style= "font-family: ' The song Body '; >    (6), create user Slackware, its ID number is 2002, Basic Group is distro, additional group Peguin;
650) this.width=650; "height=" "src="/http B200.photo.store.qq.com/psb?/v14apf1036yr41/vgogv4hvjxha9qcpqq437d67xygqhzxldpjptb6fh28!/b/dmgaaaaaaaaa&bo =tgi8aaaaaaafafm! "width=" 590 "style=" vertical-align:top; "alt=" dmgaaaaaaaaa&bo=tgi8aaaaaaafafm! "/> 

< Span style= "font-family: ' The song Body '; >    (7), modify Slackware default shell is/bin/tcsh; 
650) this.width=650; "height=" "src="/HTTP/ b200.photo.store.qq.com/psb?/v14apf1036yr41/pi1ma*. eys7l5w1zovaz76i*dlgil6c.6ykowwx.9fi!/b/dmgaaaaaaaaa&bo=0wetaaaaaaafanw! "width=" 467 "style=" Vertical-align: Top; "alt=" dmgaaaaaaaaa&bo=0wetaaaaaaafanw! "/>           

(8), add additional Group admins for user Slackware;
650) this.width=650, "height=" http://b261.photo.store.qq.com/psb?/V14ApF1036yr41/"src=". zocowchf55fnos7izirwisztv5nooyiolyqhpgjmeu!/b/daubaaaaaaaa&bo=2afkaaaaaaafaj4! "width=" 472 "style=" vertical-align:top; "alt=" daubaaaaaaaa&bo=2afkaaaaaaafaj4! "/>

(9), add password for Slackware, and require the minimum password age of 3 days, the maximum is 180 days, warning for 3 days;
650) this.width=650; "height=" src= "http://b198.photo.store.qq.com/psb?/V14ApF1036yr41/ Ra65ago.03oqipocgdsuthybuq3eoicofjekjsibtyc!/b/dmyaaaaaaaaa&bo=1wi8aaaaaaafamo! "width=" 727 "style=" vertical-align:top; "alt=" dmyaaaaaaaaa&bo=1wi8aaaaaaafamo! "/>

< Span style= "font-family: ' The song Body '; >    (10), add user OpenStack, whose ID number is 3003, base Group is clouds, additional group is Peguin and Nova;
650) this.width=650; height= "src=" Http://b200.photo.store.qq.com/psb?/V14ApF1036yr41/RBUb2mSlWWHPGNnZEpgDvfzqFwf9NODMuSV7.Lk8YJU!/b/dMgAAAAAAAAA &bo=sajpaaaaaaafan4! "width=" 688 "style=" vertical-align:top; "alt=" dmgaaaaaaaaa&bo=sajpaaaaaaafan4! "/>  

(11), add the system user MySQL, request its shell for/sbin/nologin;
650) this.width=650, "height=", "src=" http://b200.photo.store.qq.com/psb?/V14ApF1036yr41/ vtkiajuhtzf5jwi10hxalci5*4*ewf8y5wsowwhbpvi!/b/dmgaaaaaaaaa&bo=7qe6aaaaaaafapu! "width=" 493 "style=" vertical-align:top; "alt=" dmgaaaaaaaaa&bo=7qe6aaaaaaafapu! "/>

(12), use the echo command, non-interactive add a password for OpenStack.
650) this.width=650; "height=" src= "http://b347.photo.store.qq.com/psb?/V14ApF1036yr41/ 7pzimoilzykqmgcblk1pn.yfmqi*ktbzbrnng.7y5fe!/b/dfsbaaaaaaaa&bo=gqjnaaaaaaafahu! "width=" 537 "style=" vertical-align:top; "alt=" dfsbaaaaaaaa&bo=gqjnaaaaaaafahu! "/>

There are 4 groups of Linux users associated with the configuration file:

/ETC/PASSWD: Saving users and their property information

Meaning of each field

Root:x:0:0:root:/root:/bin/bash

User name: Password dot: uid:gid: Comment Information: Home directory: User default Shell

/etc/group: Group and its attribute information

The meaning of each field:

Root:x:0:root

Group name: group password dot: GID: comma-delimited list of users belonging to this group

/etc/shadow: User passwords and their associated properties

The meaning of each field:

Root:$1$mq0q9ij0$mjtq5cavkibpd5pvbflnp0:16521:0:99999:7:::

Username: encrypted Password: the date of the most recent password change: Minimum password Age: Maximum password Age: Password Disable period: Account expiration Date: Reserved field

/etc/gshadow: group password and its related properties

User and group-related administrative commands:

Useradd: Create User

-U: Specify UID

-G: Specify GID

-C: User's comment information

-D: Specify the user's home directory

-S: Specify the user's default shell program

-G: Specify additional groups for users

-r: Create a System user

Groupadd: Creating Groups

-G: Indicates GID

-R: Creating a System Group

Usermod: User Property modification

-U: New UID

-G: New GID

-G: The new Add-on group, the original additional group will be overwritten, if the original, you want to use the-a option, indicating append

-S: New default shell

-C: New annotation information

-D: New home directory, files in the original home directory are not moved to the new home directory at the same time, to move, use the-M option

-L: New name

-L: Lock the specified user

-U: Unlock the specified user

passwd: Change Password

--stdin: Don't change passwords interactively

Userdel: Deleting users

-r: Delete User home directory

Groupmod: Group Property Modification

-N: New group name

-G: New GID

Groupdel: Group Delete

GPASSWD: Group Password

-A User: Add user to the specified group

-D User: Removes additional groups of users with the current group as the group name

-A User1,user2,... : Set up a list of users with administrative rights


Common commands for Linux users and management classes

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.