当前位置:网站首页>Rhcsa certification exam exercise (configured on the first host)
Rhcsa certification exam exercise (configured on the first host)
2022-07-06 11:12:00 【avater sse】
I use the simulation environment. If you need to send me a private message
Examination requirements :
- stay mars.domain250.example.com Perform the following tasks on the .
- ○ Reexamine ○ complete Configure network settings
- ○ Reexamine ○ complete Configure your system to use the default repository
- ○ Reexamine ○ complete debugging SELinux
- ○ Reexamine ○ complete Create user accounts
- ○ Reexamine ○ complete To configure cron Homework
- ○ Reexamine ○ complete Create collaboration Directory
- ○ Reexamine ○ complete To configure NTP
- ○ Reexamine ○ complete To configure autofs
- ○ Reexamine ○ complete To configure /var/tmp/fstab jurisdiction
- ○ Reexamine ○ complete Configure user accounts
- ○ Reexamine ○ complete Find files
- ○ Reexamine ○ complete Find string
- ○ Reexamine ○ complete Create Archive
- stay venus.domain250.example.com Perform the following tasks on the .
- ○ Reexamine ○ complete Set up root password
- ○ Reexamine ○ complete Configure your system to use the default repository
- ○ Reexamine ○ complete Resize logical volume
- ○ Reexamine ○ complete Add swap
- ○ Reexamine ○ complete Create logical volumes
- ○ Reexamine ○ complete establish VDO volume
- ○ Reexamine ○ complete Configure system tuning
- ○ Reexamine ○ complete Configure container
The first question is
First step : View connection information
[[email protected] ~]# nmcli connection show
NAME UUID TYPE DEVICE
Wired connection 1 46da4a6a-06c3-6fae-eea1-ac0ca900f213 ethernet eth0
The second step : Configure the network configuration as required :
[[email protected] ~]# nmcli connection modify Wired\ connection\ 1 ipv4.method manual ipv4.addresses 172.25.250.100/24 ipv4.gateway 172.25.250.254 ipv4.dns 172.25.250.254 autoconnect yes
The third step : Set host name
[[email protected] ~]# hostnamectl set-hostname mars.domain250.example.com
Step four : View host name
[[email protected] ~]# hostname
mars.domain250.example.com
The second question is
First step : Configure the default repository used by the system
Because... Is not configured yet yum The source cannot be used vim, So it is used here vi
[[email protected] ~]# vi /etc/yum.repos.d/rhce8.repo
[BaseOS]
name=BaseOS
baseurl=http://content/rhel8.2/x86_64/dvd/BaseOS
gpgcheck=0
[AppStream]
name=AppStream
baseurl=http://content/rhel8.2/x86_64/dvd/AppStream
gpgcheck=0
Then check whether the configuration is correct and can pass
yum install vim -y
If it can be installed normally, the configuration is correct
Third question
First step :
First of all, the port used in the title is non-standard port 82
Inquire about 80 Port open
[[email protected] ~]# semanage port -l | grep 80
http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000
The second step : change selinux Strategy
[[email protected] ~]# semanage port -a -t http_port_t -p tcp 82
The third step : Reopen a terminal to view /var/www/html
We will find that the first problem needs to be changed
[[email protected] ~]# ls -lZ /var/www/html/
total 12
-rw-r--r--. 1 root root system_u:object_r:default_t:s0 14 Dec 5 10:24 file1
-rw-r--r--. 1 root root system_u:object_r:httpd_sys_content_t:s0 14 Dec 5 10:24 file2
-rw-r--r--. 1 root root system_u:object_r:httpd_sys_content_t:s0 14 Dec 5 10:24 file3
change command : ( notes :-R Search for recursion )
[[email protected] ~]# chcon -t httpd_sys_content_t -R /var/www/html/
Look again :
[[email protected] ~]# ls -lZ /var/www/html/
total 12
-rw-r--r--. 1 root root system_u:object_r:httpd_sys_content_t:s0 14 Dec 5 10:24 file1
-rw-r--r--. 1 root root system_u:object_r:httpd_sys_content_t:s0 14 Dec 5 10:24 file2
-rw-r--r--. 1 root root system_u:object_r:httpd_sys_content_t:s0 14 Dec 5 10:24 file3
Change complete
Step four : Turn on httpd service
After startup, it starts automatically
[[email protected] ~]# systemctl start httpd
[[email protected] ~]# systemctl enable httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Or merge the two commands :
[[email protected] ~]# systemctl enable --now httpd
Check : There are problems before the visit file1
[[email protected] ~]# curl http:/mars:82/file1
EX200 Testing
optional :
Release at the firewall 82 port
[[email protected] ~]# firewall-cmd --permanent --add-port=82/tcp
success
Effective immediately now
[[email protected] ~]# firewall-cmd --reload
success
Fourth question
First step :
Create a sysmgrs Group
[[email protected] ~]# groupadd sysmgrs
The second step :
user natasha , Subordinate to as a secondary group sysmgrs
[[email protected] ~]# useradd natasha -G sysmgrs
The third step :
user harry , As a secondary group, it also belongs to sysmgrs
[[email protected] ~]# useradd harry -G sysmgrs
Step four :
user sarah , You do not have access to interactive on the system shell It's not sysmgrs Members of
[[email protected] ~]# useradd sarah -s /bin/false
Step five :
natasha 、 harry and sarah All passwords should be flectrag
Changing password for user natasha.
passwd: all authentication tokens updated successfully.
[[email protected] ~]# echo flectrag | passwd --stdin harry
Changing password for user harry.
passwd: all authentication tokens updated successfully.
[[email protected] ~]# echo flectrag | passwd --stdin sarah
Changing password for user sarah.
passwd: all authentication tokens updated successfully.sh
Fifth question
Representation format : Time sharing day month week
[[email protected] ~]# crontab -u natasha -e
*/2 * * * * logger "EX200 in progress"
It may also be investigated in another way :
example : Every day 14:23 branch natasha perform echo “Hi rhcsa”
crontab -eu natasha
23 14 * * * echo "Hi rhcsa"
Sixth question
First step : Create directory
[[email protected] ~]# mkdir /home/managers
The second step : Add group permissions
[[email protected] ~]# chgrp sysmgrs /home/managers/
see /home/managers Permissions owned
[[email protected] ~]# ll /home/managers/ -d
drwxr-xr-x. 2 root sysmgrs 6 Dec 5 15:29 /home/managers/
The third step : Group users have all permissions , Other users don't
meanwhile /home/managers Files created in automatically set group ownership to sysmgrs Group
[[email protected] ~]# chmod g+ws /home/managers/
[[email protected] ~]# chmod o=- /home/managers/
[[email protected] ~]# ll /home/managers/ -d
drwxrws---. 2 root sysmgrs 6 Dec 5 15:29 /home/managers/
Question seven
First step : Check whether the package is installed :
[[email protected] ~]# rpm -q chrony
chrony-3.5-1.el8.x86_64
If not installed
yum install chrony -y
The second step : Modify the configuration file
[[email protected] ~]# vim /etc/chrony.conf
Divide by the last server Are commented out
The third step : Remember to configure self startup when encountering Services
[[email protected] ~]# systemctl restart chronyd.service
[[email protected] ~]# systemctl enable chronyd.service
Step four : See if the configuration is successful
[[email protected] ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* classroom.example.com 8 6 77 36 +70us[+2031us] +/- 1749us
The eighth question
First step : install autofs
[[email protected] ~]# yum install autofs -y
The second step : Write file
[[email protected] ~]# vim /etc/auto.master
Add the upper interface directory
#
/misc /etc/auto.misc
/rhome /etc/auto.nfs
The third step : Write a sub configuration file
[[email protected] ~]# vim /etc/auto.nfs
remoteuser1 -fstype=nfs,rw materials.example.com:/rhome/remoteuser1
Open another terminal
[[email protected] ~]# vim /etc/auto.misc
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
Copy the uncommented ones to the sub configuration and change
Save and exit
Step four : Set power on self start
[[email protected] ~]# systemctl enable --now autofs
Step five : Test success , Remote login
[[email protected] ~]$ ssh [email protected]
[email protected]'s password:
Activate the web console with: systemctl enable --now cockpit.socket
This system is not registered to Red Hat Insights. See https://cloud.redhat.com/
To register this system, run: insights-client --register
Question 9
First step : Copy the file
[[email protected] ~]# cp /etc/fstab /var/tmp/fstab
Check the file permissions :
[[email protected] ~]# ll /var/tmp/fstab
-rw-r--r--. 1 root root 534 Dec 5 16:32 /var/tmp/fstab
It is found that the first three are configured
The second step : To configure natasha
[[email protected] ~]# setfacl -m u:natasha:rw /var/tmp/fstab
The third step : To configure harry
[[email protected] ~]# setfacl -m u:harry:- /var/tmp/fstab
Question 10
[[email protected] ~]# useradd manalo -u 3533
[[email protected] ~]# echo flectrag | passwd --stdin manalo
Changing password for user manalo.
passwd: all authentication tokens updated successfully.
Eleventh questions
First step : Check whether the user and directory exist
[[email protected] ~]# id jacques
uid=1003(jacques) gid=1003(jacques) groups=1003(jacques)
[[email protected] ~]# ll /root/
total 16
-rw-------. 1 root root 6503 Apr 23 2020 anaconda-ks.cfg
-rw-------. 1 root root 6251 Apr 23 2020 original-ks.cfg
[[email protected] ~]#
Found that the directory does not exist
So create a directory
[[email protected] ~]# mkdir /root/findfiles
The second step : Find the file and put it in the new directory
[[email protected] ~]# find / -user jacques -type f -exec cp -a {} /root/findfiles \;
[[email protected] ~]# ls /root/findfiles/
gamelan jacques libWedgeit.so.1.2.3
Twelfth questions
[[email protected] ~]# grep ng /usr/share/xml/iso-codes/iso_639_3.xml > /root/list
Thirteenth questions
[[email protected] ~]# tar czf /root/backup.tar.gz /usr/local
tar: Removing leading `/' from member names
边栏推荐
- ++Implementation of I and i++
- Ansible实战系列一 _ 入门
- Armv8-a programming guide MMU (2)
- CSDN问答模块标题推荐任务(一) —— 基本框架的搭建
- 虚拟机Ping通主机,主机Ping不通虚拟机
- Django running error: error loading mysqldb module solution
- Swagger, Yapi interface management service_ SE
- Solve the problem that XML, YML and properties file configurations cannot be scanned
- [BMZCTF-pwn] 11-pwn111111
- 虚拟机Ping通主机,主机Ping不通虚拟机
猜你喜欢
Swagger, Yapi interface management service_ SE
[download app for free]ineukernel OCR image data recognition and acquisition principle and product application
自动机器学习框架介绍与使用(flaml、h2o)
[free setup] asp Net online course selection system design and Implementation (source code +lunwen)
A brief introduction to the microservice technology stack, the introduction and use of Eureka and ribbon
CSDN question and answer module Title Recommendation task (II) -- effect optimization
csdn-Markdown编辑器
MySQL master-slave replication, read-write separation
Installation and use of MySQL under MySQL 19 Linux
AcWing 1298.曹冲养猪 题解
随机推荐
Yum prompt another app is currently holding the yum lock; waiting for it to exit...
Did you forget to register or load this tag 报错解决方法
Win10: how to modify the priority of dual network cards?
windows下同时安装mysql5.5和mysql8.0
引入了junit为什么还是用不了@Test注解
[number theory] divisor
MySQL other hosts cannot connect to the local database
MySQL完全卸载(Windows、Mac、Linux)
Remember the interview algorithm of a company: find the number of times a number appears in an ordered array
QT creator specify editor settings
csdn-Markdown编辑器
02 staff information management after the actual project
Why is MySQL still slow to query when indexing is used?
CSDN问答模块标题推荐任务(一) —— 基本框架的搭建
Some notes of MySQL
Solve the problem that XML, YML and properties file configurations cannot be scanned
Postman Interface Association
【博主推荐】asp.net WebService 后台数据API JSON(附源码)
[free setup] asp Net online course selection system design and Implementation (source code +lunwen)
npm一个错误 npm ERR code ENOENT npm ERR syscall open