A little exercise in the Linux environment

Source: Internet
Author: User
Tags chrony

IPADDR:172.25.X.100 (x here refers to your workstation number)
netmask:255.255.255.0
gateway:172.25.x.254
dns:172.25.254.254

650) this.width=650; "title=" screenshot from 2017-08-02 15-58-43.png "src=" https://s2.51cto.com/wyfs02/M01/9D/91/ Wkiom1mb60cjdsrhaabgjxk4-ua049.png "alt=" Wkiom1mb60cjdsrhaabgjxk4-ua049.png "/>

@@ 在 Choose to use the GUI to add or edit text directly to obtain IP and DNS, in order to avoid errors, it is recommended to use the graphical interface to add

the Yum source address is: ftp://172.25.x.250/pub/rhel7.0

650) this.width=650; "title=" screenshot from 2017-08-02 15-59-04.png "src=" https://s3.51cto.com/wyfs02/M02/9D/91/ Wkiol1mb68ujcppqaabhxlxvqrw276.png "alt=" Wkiol1mb68ujcppqaabhxlxvqrw276.png "/>

650) this.width=650; "title=" screenshot from 2017-08-02 16-00-19.png "src=" https://s3.51cto.com/wyfs02/M01/9D/91/ Wkiol1mb6-oaap1oaaauom5mj-s795.png "alt=" Wkiol1mb6-oaap1oaaauom5mj-s795.png "/>

# #注意: When configuring the Yum source, delete the/ETC/YUM.REPOS.D directory all files, and then create a new Xxx.repo file, be sure to end with. Repo, and then write the configuration of the Yum source in it.

1.
Please reset the root user password to Examwestos before taking the exam.

650) this.width=650; "title=" screenshot from 2017-08-02 16-01-08.png "src=" https://s3.51cto.com/wyfs02/M01/9D/91/ Wkiom1mb7pliy4w0aabxve5le9m249.png "alt=" Wkiom1mb7pliy4w0aabxve5le9m249.png "/>

2.
Change the host name to Station.domainX.example.com (X here refers to your workstation number)

650) this.width=650; "title=" screenshot from 2017-08-02 16-02-56.png "src=" https://s5.51cto.com/wyfs02/M02/9D/91/ Wkiom1mb7r6gwn6jaaccgg7f8_0255.png "alt=" Wkiom1mb7r6gwn6jaaccgg7f8_0255.png "/>3
Create a new group with the name Sysadms, specifying its GID to be 600

650) this.width=650; "title=" screenshot from 2017-08-02 16-10-58.png "src=" https://s2.51cto.com/wyfs02/M02/9D/91/ Wkiol1mb7tfjwzkqaaaxyn_z8du570.png "alt=" Wkiol1mb7tfjwzkqaaaxyn_z8du570.png "/>

@@ 在 if written Groupadd Sysadms-g 600 is also possible, personally tested.

4
New user Tommy, specify UID 2013, configure the user password to Redhat

650) this.width=650; "title=" screenshot from 2017-08-02 16-11-23.png "src=" https://s4.51cto.com/wyfs02/M01/9D/91/ Wkiol1mb7yjhvzzmaacadcnydpk387.png "alt=" Wkiol1mb7yjhvzzmaacadcnydpk387.png "/>

5
New user Jimmy, and disable the user's interactive logon, configure the user password to Redhat

650) this.width=650; "title=" screenshot from 2017-08-02 16-13-01.png "style=" Float:none; "src=" https://s3.51cto.com/ Wyfs02/m02/9d/91/wkiom1mb7ayqqjfaaabwv9gjh3s086.png "alt=" Wkiom1mb7ayqqjfaaabwv9gjh3s086.png "/>

# #这里说到的禁止交互式登录, just modify the shell of the Jimmy user in the/etc/passwd file and change the/bin/sh to/sbin/nologin.


6
Create a new user Natasha,harry and add the two users to the SYSADMS group as the subordinate group and, if necessary, configure the user password to Redhat

650) this.width=650; "title=" screenshot from 2017-08-02 16-15-40.png "src=" https://s2.51cto.com/wyfs02/M02/9D/91/ Wkiol1mb7s7hjrhhaab_uwqgd8y240.png "alt=" Wkiol1mb7s7hjrhhaab_uwqgd8y240.png "/>

# #指定用户组的时候, this group must be there.

7
Create a directory in the/home directory materials, the group that is configured for this directory is SYSADMS, requires members of the SYSADMS group to have read and write permissions to the directory, the file or folder created in the Sysadms directory, and its owning group
Automatically inherit SYSADMS group 650) this.width=650; "title=" screenshot from 2017-08-02 16-22-29.png "src=" https://s1.51cto.com/ Wyfs02/m00/9d/91/wkiom1mb7yeqfjcjaabarmbgpng959.png "alt=" Wkiom1mb7yeqfjcjaabarmbgpng959.png "/>

@@ 在, the members of the SYSADMS group have read and write permissions to the directory, no execute permissions, then set the group permissions to 6, and also precede the permissions with a mandatory bit.

8
Copy the/etc/fstab file to the/var/tmp directory and set the following requirements
So that Harry's users have no permissions on the file
Enable Natasha to have full control of the file
Configuration file belongs to user root
Configuration file belongs to group root
All other users have read access to the file
All other users do not have permission to execute files

650) this.width=650; "title=" screenshot from 2017-08-02 16-41-38.png "style=" Float:none; "src=" https://s1.51cto.com/ Wyfs02/m02/9d/91/wkiom1mb8lkxklllaacjyyppzdi699.png "alt=" Wkiom1mb8lkxklllaacjyyppzdi699.png "/>


9
Set up an NTP client to synchronize time with 172.25.x.254

650) this.width=650; "title=" screenshot from 2017-08-02 16-44-26.png "style=" Float:none; "src=" https://s5.51cto.com/ Wyfs02/m00/9d/91/wkiom1mb8rbchyniaabffp0by_o768.png "alt=" Wkiom1mb8rbchyniaabffp0by_o768.png "/>

@@ 设置 time synchronization, to first install the Chrony service, and then edit the/etc/chrony.conf file, I give here is the client's editing content, to really realize the time synchronization, the server also to file configuration.

650) this.width=650; "title=" screenshot from 2017-08-02 16-47-05.png "style=" Float:none; "src=" https://s5.51cto.com/ Wyfs02/m01/9d/91/wkiom1mb8redi0a8aaejkdzolme133.png "alt=" Wkiom1mb8redi0a8aaejkdzolme133.png "/>

The effect that occurs after the server has set up synchronization


10
Locate the files owned by the user group mail and place them in the/root/findresults directory 650) this.width=650; "title=" screenshot from 2017-08-02 16-57-58.png "src= "Https://s4.51cto.com/wyfs02/M01/9D/91/wKiom1mB8j_RYkY4AAD3E31TwW4016.png" alt= "wkiom1mb8j_ Ryky4aad3e31tww4016.png "/>

11
Find all lines containing ich in the file/usr/share/mime/packages/freedesktop.org.xml, will find
The lines are copied to/root/lines in sequence.

650) this.width=650; "title=" screenshot from 2017-08-02 17-10-04.png "src=" https://s3.51cto.com/wyfs02/M02/9D/91/ Wkiol1mb8q7jhfuyaaa9zl_e9os462.png "alt=" Wkiol1mb8q7jhfuyaaa9zl_e9os462.png "/>

@@ 这里 uses the grep command, which is filtered to filter all lines containing ICH and then redirected to the specified file.

File, the/root/lines file does not contain spaces, and the contents of the line are the exact copy of the source file/usr/share/mime/packages/freedesktop.org.xml original line

650) this.width=650; "title=" screenshot from 2017-08-02 17-08-50.png "src=" https://s5.51cto.com/wyfs02/M02/9D/91/ Wkiol1mb8z6johjoaaapmadhmoa745.png "alt=" Wkiol1mb8z6johjoaaapmadhmoa745.png "/>

# #在vim的命令模式下进行编辑, "^\ *" means all the spaces at the beginning of the line, here does not use ":%s///g" Because this command is a global replacement, after the operation, even the space between the words will disappear, which changed the meaning of the original word.

A little exercise in the Linux environment

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.