Exam Information:
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
The Yum source address is: ftp://172.25.x.250/pub/rhel7.0
1. Before you take the exam, reset the root user password to Examwestos
[Email protected] ~]# passwd
Changing password for user root.
New Password:
Retype new Password:
Passwd:all authentication tokens updated successfully.
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M00/89/B9/wKiom1gaxNnDQUDoAAB3jRun0wc557.jpg "style=" float: none; "Title=" Captures 1. JPG "alt=" Wkiom1gaxnndqudoaab3jrun0wc557.jpg "/>
2. Change the host name to Station.domainX.example.com (X here refers to your workstation number)
[Email protected] ~]# Hostnamectl set-hostname station.domain19.example.com
[Email protected] ~]# hostname
Station.domain19.example.com
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M00/89/B9/wKiom1gaxNmzpwfFAACcBVD35-Y074.jpg "style=" float: none; "Title=" Captures 2. JPG "alt=" Wkiom1gaxnmzpwffaaccbvd35-y074.jpg "/>
3 new group, named Sysadms, specifying its GID as 600
[Email protected] ~]# groupadd-g SYSADMS
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M00/89/B6/wKioL1gaxNrjGYavAABUh1n_JDE006.jpg "title=" Capture 3. JPG "style=" Float:none; "alt=" wkiol1gaxnrjgyavaabuh1n_jde006.jpg "/>
4 New user Tommy, specify UID 2013, configure the user password to Redhat
[Email protected] ~]# useradd-u Tommy
[[email protected] ~]# ID Tommy
uid=2013 (Tommy) gid=2013 (Tommy) groups=2013 (Tommy)
[Email protected] ~]# passwd Tommy
Changing password for user Tommy.
New Password:
Bad Password:the PASSWORD is shorter than 8 characters
Retype new Password:
Passwd:all authentication tokens updated successfully.
[Email protected] ~]#
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/89/B6/wKioL1gaxNrCGxVzAADJ4sP2JMw281.jpg "style=" float: none; "Title=" Captures 4. JPG "alt=" Wkiol1gaxnrcgxvzaadj4sp2jmw281.jpg "/>
5 new user Jimmy, and disable the user's interactive logon, configure the user password to Redhat
[Email protected] ~]# cat/etc/shells # #通过该命令可以查看该系统可支持的shell类型
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh
[Email protected] ~]# useradd-s/sbin/nologin Jimmy
[Email protected] ~]# passwd Jimmy
Changing password for user Jimmy.
New Password:
Bad Password:the PASSWORD is shorter than 8 characters
Retype new Password:
Passwd:all authentication tokens updated successfully.
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M02/89/B6/wKioL1gaxNmRISiUAADZ7ECBvQ0135.jpg "style=" float: none; "title=" capture. 5jpg.jpg "alt=" Wkiol1gaxnmrisiuaadz7ecbvq0135.jpg "/>
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
[Email protected] ~]# useradd-g SYSADMS Natasha
[Email protected] ~]# useradd-g Sysadms Harry
[Email protected] ~]# passwd Natasha
Changing password for user Natasha.
New Password:
Bad Password:the PASSWORD is shorter than 8 characters
Retype new Password:
Passwd:all authentication tokens updated successfully.
[Email protected] ~]# passwd Harry
Changing password for user Harry.
New Password:
Bad Password:the PASSWORD is shorter than 8 characters
Retype new Password:
Passwd:all authentication tokens updated successfully.
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/89/B9/wKiom1gaxNvziq6EAAD7iUo3e40500.jpg "title=" Capture 6. JPG "style=" Float:none; "alt=" wkiom1gaxnvziq6eaad7iuo3e40500.jpg "/>
7 Create directory materials in the/home directory, configure this directory to belong to the group SYSADMS, require members of the SYSADMS group to have read and write permissions to the directory,
The files or folders created in the Sysadms directory, and the groups they belong to
Automatically inherit the owning group of SYSADMS
[Email protected] ~]# mkdir/home/materials
[Email protected] ~]# chgrp sysadms/home/materials-r
[Email protected] ~]# chmod g+rw/home/materials
[Email protected] ~]# chmod g+s/home/materials
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/89/B9/wKiom1gaxNuQDkMMAACBUA3QKkY750.jpg "style=" float: none; "Title=" Captures 7. JPG "alt=" Wkiom1gaxnuqdkmmaacbua3qkky750.jpg "/>
8 Copy the/etc/fstab file to the/var/tmp directory, set the following requirements
[Email protected] ~]# cp/etc/fstab/var/tmp/
So that Harry's users have no permissions on the file
[Email protected] ~]# setfacl-m U:harry:/var/tmp/fstab
Setfacl:option-m Incomplete
Enable Natasha to have full control of the file
[Email protected] ~]# setfacl-m U:natasha:rwx/var/tmp/fstab
Configuration file belongs to user root
[Email protected] ~]# chown Root/var/tmp/fstab
Configuration file belongs to group root
[Email protected] ~]# chgrp Root/var/tmp/fstab
All other users have read access to the file
[Email protected] ~]# chmod o+r/var/tmp/fstab
All other users do not have permission to execute files
[Email protected] ~]# chmod o-x/var/tmp/fstab
9 Setting up an NTP client to synchronize time with 172.25.x.254
[Email protected] ~]# vim/etc/chrony.conf
3 Server 172.25.19.254 Iburst
[Email protected] ~]# systemctl restart Chronyd.service
# #客户端不用关闭防火墙, the server must shut down the firewall
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/89/B6/wKioL1gaxNvDBYsbAAD2v86Xi88878.jpg "style=" float: none; "Title=" Captures 8. JPG "alt=" Wkiol1gaxnvdbysbaad2v86xi88878.jpg "/>
10 Locate the files owned by the user group mail and place them in the/root/findresults directory
11 Find all lines containing ich in file/usr/share/mime/packages/freedesktop.org.xml, will find
The lines are copied to/root/lines in sequence.
File, the/root/lines file does not contain spaces, and the contents of the row are the source file/usr/share/mime/packages/freedesktop.org.xml the original line.
Accurate copy
"Rh124-exam" Linux Exercises