LINUX Redhat Fifth Unit documentation

Source: Internet
Author: User

I. User understanding
The user is the identity of the system consumer
The user is stored in the system as a number of channeling characters + several system configuration files
User information involves the system configuration file:
/ETC/PASSWD # # #用户信息
User: Password: uid:gid: Description: Home directory: User-used Shell
/etc/shadow # # #用户认证信息
User: Password: Last password modified this time: Minimum validity: Maximum validity: Warning Period: Inactive period: Account expiration date
/etc/group # # #组信息
Group name: Group password: Group ID: Additional Group member
/etc/gshadow # # #组认证信息
/home/username # # #用户家目录
/etc/skel/.* # # #用户骨架文件650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/8F/8A/ Wkiom1jkgjgdzhj7aaif8az1fza638.png-wh_500x0-wm_3-wmp_4-s_3227701314.png "title=" Screenshot from 2017-03-25 09-21-45.png "alt=" Wkiom1jkgjgdzhj7aaif8az1fza638.png-wh_50 "/>



Two. User Management


1. User Establishment
Useradd parameter User name
-U # #指定用户uid
-G # #指定用户初始组信息, this group must already exist
-G # #指定附加组, this group must exist
-C # #用户说明
-D # #用户家目录
-S # #用户所使用的shell,/etc/shells records the name of the user who can use the shell


650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/8F/8C/wKiom1jkjMnBqvZbAAoCqAcaphk472.png "style=" float : none; "title=" 1.png "alt=" Wkiom1jkjmnbqvzbaaocqacaphk472.png "/>

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/8F/8A/wKioL1jkjM6yHZyxAAoInRY5LKg980.png "style=" float : none; "title=" 2.png "alt=" Wkiol1jkjm6yhzyxaaoinry5lkg980.png "/>

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/8F/8A/wKioL1jkjNPR3wO6AAoEYI4NfxI779.png "style=" float : none; "title=" 3.png "alt=" Wkiol1jkjnpr3wo6aaoeyi4nfxi779.png "/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/8F/8C/wKiom1jkjNnygsoEAAoBI5ytgyQ807.png "style=" float : none; "title=" 4.png "alt=" Wkiom1jkjnnygsoeaaobi5ytgyq807.png "/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/8F/8A/wKioL1jkjN7A_wIVAAoB9Ejgb3E995.png "style=" float : none; "title=" 5.png "alt=" Wkiol1jkjn7a_wivaaob9ejgb3e995.png "/>

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/8F/8C/wKiom1jkjOST7mcmAAoa37YdtRE422.png "style=" float : none; "title=" 6.png "alt=" Wkiom1jkjost7mcmaaoa37ydtre422.png "/>





2. User Delete
Userdel-r User name-R means delete user information and user's system configuration

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8F/8C/wKiom1jkjYTCA2KBAAoArNGUxWw124.png-wh_500x0-wm_ 3-wmp_4-s_23614390.png "title=" screenshot from 2017-04-05 14-23-46.png "alt=" Wkiom1jkjytca2kbaaoarnguxww124.png-wh_ "/>
3. Establishment of groups
GROUPADD-G # #建立组
Groupdel Group Name # #删除组
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8F/8A/wKioL1jkjnbiIkqTAAnpPDxj3gA172.png-wh_500x0-wm_ 3-wmp_4-s_1000825444.png "title=" screenshot from 2017-04-05 14-27-50.png "alt=" Wkiol1jkjnbiikqtaanppdxj3ga172.png-wh_50 "/> As the monitoring command for the above experiment:
Watch-n 1 ' tail-n 3/etc/passwd/etc/group;echo ====;ls-l/home;echo ===;ls-l/mnt '


4. User ID Information view
ID parameter user
-U # #用户uid
-G # #用户初始组id
-G # #用户所有所在组id
-N # #显示名称而不是id数字
-A # #显示所有信息

650) this.width=650; "Src=" Https://s3.51cto.com/wyfs02/M02/8F/8A/wKioL1jkj8vSnDS5AAmJBY4IFuI861.png-wh_ 500x0-wm_3-wmp_4-s_2039363029.png "title=" screenshot from 2017-04-05 14-33-08.png "alt=" Wkiol1jkj8vsnds5aamjby4ifui861.png-wh_50 "/>
5. User information changes
usermod     parameters      Users
    -l    # #更改用户名称
    -u    # #更改uid
     -g    # #更改gid
    -G    # #更改附加组
     -ag    # #添加附加组
    -c    # #更改说明
    -d     # #更改家目录指定
    -md    # #更改家目录指定及家目录名称
    -s     # #更改shell
    -L    # #冻结帐号
    -U    # #解锁


650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/8F/8A/wKioL1jklFvg5s6cAAplzLk35C4876.png-wh_500x0-wm_ 3-wmp_4-s_3557502165.png "title=" screenshot from 2017-04-05 14-53-00.png "alt=" Wkiol1jklfvg5s6caaplzlk35c4876.png-wh_50 "/>

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8F/8A/wKioL1jklMOzpflRAAmbiu3gSq8988.png-wh_500x0-wm_ 3-wmp_4-s_268928021.png "style=" Float:none; "title=" screenshot from 2017-04-05 14-54-31.png "alt=" Wkiol1jklmozpflraambiu3gsq8988.png-wh_50 "/>

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/8F/8A/wKioL1jklMiSHzmKAAmrRZIyoLo911.png-wh_500x0-wm_ 3-wmp_4-s_202946237.png "style=" Float:none; "title=" screenshot from 2017-04-05 14-54-38.png "alt=" Wkiol1jklmishzmkaamrrziyolo911.png-wh_50 "/>



Three. User decentralization


1. Power Users in the system can delegate actions that ordinary users cannot perform to the normal user
Delegating power profile:/etc/sudoers

2. Methods of decentralization
*) Super User execution Visudo enter edit/etc/ Sudoers Mode
*) format:
Get rights user      Host name = (acquired user identity)      command
test     desktop0.example.com= (Root)     /usr/sbin/useradd
Test user can execute/usr/as Superuser in desktop0.example.com Sbin/useradd


3. Implementation of the delegation of authority command
sudo command # #如果第一次执行sudo需要输入当前用户密码
In/etc/sudoers if the settings are as follows:
Test desktop0.example.com= (Root) nopasswd:/usr/sbin/useradd
Indicates that the user does not need their own password when invoking the sudo command

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/8F/8A/wKioL1jkl0rBwLvvAAmRJv6M5jc172.png-wh_500x0-wm_ 3-wmp_4-s_810214942.png "title=" screenshot from 2017-04-05 15-05-27.png "alt=" Wkiol1jkl0rbwlvvaamrjv6m5jc172.png-wh _50 "/>
Four. Control of user authentication information

Chage parameter User
-D # #用户密码组后一次修改的时间, if set to 0, users must change their password after logging into the system
-M # #最短有效期
-M # #最长有效期
-W # #警告期
-I # #用户非活跃天数
-E # #帐号到期日格式-E "Yyyy-mm-dd"


LINUX redhat Fifth Unit document

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.