红帽认证技师(RHCSA)练习
配置您的系统以使用默认存储库
YUM 存储库已可以从 http://content/rhel8.0/x86_64/dvd/BaseOS 和 http://content/rhel8.0/x86_64/dvd/AppStream 使用配置您的系统,以将这些位置用作默认存储库。
解题方法:
[root@mars ~]# cd /etc/yum.repos.d/
[root@mars ~]# vim rhcsa.repo
[BaseOS]
name=BaseOS
baseurl=http://content/rhel8.0/x86_64/dvd/BaseOS
enabled=1
gpgcheck=0
[AppStream]
name=AppStream
baseurl=http://content/rhel8.0/x86_64/dvd/AppStream
enabled=1
gpgcheck=0
调试 SELinux
非标准端口 82 上运行的 Web 服务器在提供内容时遇到问题。根据需要调试并解决问题,使其满足以下条件:
系统上的 Web 服务器能够提供 /var/www/html 中所有现有的 HTML 文件(注:不要删除或以其他方式改动现有的文件内容)
Web 服务器在端口 82 上提供此内容
Web 服务器在系统启动时自动启动
解题方法:
[root@mars ~]# semanage port -a -t http_port_t -p tcp 82
[root@mars ~]# ls -ldZ /var/www/html/
[root@mars ~]# semanage fcontext -a -t httpd_sys_content_t "/var/www/html/file1"
[root@mars ~]# restorecon -v /var/www/html/file1
[root@mars ~]# systemctl restart httpd
[root@mars ~]# systemctl enable httpd
创建用户帐户
创建下列用户、组和组成员资格:
名为 sysmgrs 的组
用户 natasha ,作为次要组从属于 sysmgrs
用户 harry ,作为次要组还从属于 sysmgrs
用户 sarah ,无权访问系统上的交互式 shell 且不是 sysmgrs 的成员
natasha 、 harry 和 sarah 的密码应当都是 flectrag
解题方法:
[root@mars ~]# groupadd sysmgrs
[root@mars ~]# useradd -G sysmgrs natasha
[root@mars ~]# useradd -G sysmgrs harry
[root@mars ~]# useradd -s /bin/false sarah
[root@mars ~]# passwd natasha
[root@mars ~]# passwd harry
[root@mars ~]# passwd sarah
配置 cron 作业
配置 cron 作业,该作业每隔 2 分钟运行并执行以下命令:
logger "EX200 in progress",以用户 natasha 身份运行
解题方法:
[root@mars ~]# crontab -e -u natasha
*/2 * * * * logger "EX200 in progress"
COPYRIGHT © 2016 – 2026 ALL RIGHTS RESERVED.粤ICP备17127827号