Linux 第5-6 Chapter Work experiment

Source: Internet
Author: User

<<< Five-six unit exercise >>>

1. Create a new user group, Shengchan,caiwu,jishu


2. New user requirements are as follows:


* Tom is an additional user of the Shengchan group

* Harry is an additional user of the Caiwu group

* Leo is an additional user of the Jishu group

* Create a new Admin user, this user does not belong to the above mentioned three departments

3. The new directory requires the following:

*/pub directory for public storage directory for all users can read, write, execute, but users can only delete files belonging to their own

*/SC directory for production department storage Directory can only be written to the production department personnel, and the production department personnel created by the files are automatically attributed to the Shengchan group

*/CW Directory for the Finance Department storage directory can only be written to the Finance department personnel, and the financial department personnel created by the documents are automatically attributed to the Caiwu group

* Admin user can use Touch tool to create files in/sc directory and/CW directory, but cannot delete files.


4. Set normal user new file permission to "r--r-----"



5. Set Admin user can freely create new user via sudo

The experimental process is as follows:

Create groups, create users,

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/88/A4/wKiom1f968rBlGDoAAFgkHGEJmE488.png-wh_500x0-wm_3 -wmp_4-s_3417544745.png "title=" screenshot from 2016-10-11 09_12_23.png "style=" Float:none; "alt=" Wkiom1f968rblgdoaafgkhgejme488.png-wh_50 "/>

Settings for user rights

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/88/A4/wKiom1f968qA7KH8AAE4ExONCtM238.png-wh_500x0-wm_3 -wmp_4-s_3143769356.png "title=" screenshot from 2016-10-11 09_16_54.png "style=" Float:none; "alt=" Wkiom1f968qa7kh8aae4exonctm238.png-wh_50 "/>

Command: Visudo, configure system files, implement the decentralization of rights

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/88/A1/wKioL1f97AGAhU5WAAGoNA1BTHc186.png-wh_500x0-wm_3 -wmp_4-s_955720826.png "style=" Float:none; "title=" screenshot from 2016-10-11 09_25_41.png "alt=" Wkiol1f97agahu5waagona1bthc186.png-wh_50 "/>

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/88/A4/wKiom1f97AHQCuJMAADaRQ0roXs783.png-wh_500x0-wm_3 -wmp_4-s_793753338.png "style=" Float:none; "title=" screenshot from 2016-10-11 09_30_58.png "alt=" Wkiom1f97ahqcujmaadarq0roxs783.png-wh_50 "/>

#vim/ETC/BASHRC

#vim/etc/profile

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/88/A4/wKiom1f97AKSGBOaAAFBrMWp_MI219.png-wh_500x0-wm_3 -wmp_4-s_33601687.png "style=" Float:none; "title=" screenshot from 2016-10-11 09_35_46.png "alt=" Wkiom1f97aksgboaaafbrmwp_mi219.png-wh_50 "/>

Effect

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/88/A1/wKioL1f97APjPf__AAG5Qu4oZYo864.png-wh_500x0-wm_3 -wmp_4-s_1227700027.png "style=" Float:none; "title=" screenshot from 2016-10-11 09_47_44.png "alt=" wKioL1f97APjPf__ Aag5qu4ozyo864.png-wh_50 "/>

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/88/A1/wKioL1f97APQkWWMAAG5dI0GgcQ454.png-wh_500x0-wm_3 -wmp_4-s_97629562.png "style=" Float:none; "title=" screenshot from 2016-10-11 09_47_52.png "alt=" Wkiol1f97apqkwwmaag5di0ggcq454.png-wh_50 "/>

Delegation of authority to touch commands

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/88/A1/wKioL1f97ASgn3S2AAFV9-4wc4A501.png-wh_500x0-wm_3 -wmp_4-s_589167697.png "style=" Float:none; "title=" screenshot from 2016-10-11 09_50_00.png "alt=" Wkiol1f97asgn3s2aafv9-4wc4a501.png-wh_50 "/>

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/88/A1/wKioL1f97AWyg6DWAADKCXdHF7E544.png-wh_500x0-wm_3 -wmp_4-s_4099573476.png "style=" Float:none; "title=" screenshot from 2016-10-11 09_51_03.png "alt=" Wkiol1f97awyg6dwaadkcxdhf7e544.png-wh_50 "/>

3. Changes to the file user group

Chown User name file # #更改文件所有人

chgrp Group name file # #更改文件所有组

Chown-r Users Catalogue # #更改目录本身以及目录中的子文件的所有人

chgrp-r Group name Catalogue # #更改目录本身以及目录中的子文件的所有组

4. Recognition of permissions

Ls-l in 2-10 characters for file permissions

rwx R-x R-x

User Rights Group member permissions Other user rights

Types of permissions

R

R permissions for files, which means you can view the contents of a file

R permissions for the directory, which means that you can view the file names that exist in the directory

W

W permissions against the file, indicating that the contents of the file can be changed

W permissions for the directory, indicating whether sub-files or subdirectories in the directory can be deleted

X

X permission for the file, indicating whether the program that is logged in the file can be opened

X permission for the directory, indicating whether it can be entered in the directory

chmod ugo+-=rwx # #改权限

u=rwx=7 |g=rwx=7|o=rwx=7

421

U=rw-=6 g=r--=4 o=r--=4 644

R=4

w=2

X=1

-=0

7=rwx,6=rw-,5=r-x,4=r--,3=-wx,2=-w-,1=--x,0=---

5. Default permissions for Files

umask # #显示系统预留权限值

VIM/ETC/BASHRC 71 rows is a change for a normal user, and 73 is a superuser change

Vim/etc/profile 60 rows is a change for a normal user, and 62 is a superuser change

SOURCE/ETC/BASHRC # #刷新bash配置

Source/etc/profile # # Refresh System Configuration


Linux 第5-6 Chapter Work experiment

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.