服务管理
红帽认证 · 考点例题与解析
📘 教材推导
📘 依据出处:该考点依据教材与考试大纲整理,无单一条款出处
单选题
使用 crontab -e 为用户配置每天 2:30 执行脚本,正确写法是
A. 30 2 * * * root /root/backup.sh
B. 2 30 * * * /root/backup.sh
C. * * 2 30 * /root/backup.sh
D. 30 2 * * * /root/backup.sh
正确答案:D
cron 格式为 分 时 日 月 周;用户级 crontab 不含用户字段。
单选题
使用 at 命令在 5 分钟后执行某命令脚本,正确的交互方式是
A. at now + 5 minutes 然后输入命令并以 Ctrl-D 结束
B. at 5m /root/backup.sh
C. at -t 5 /root/backup.sh
D. at run 5min
正确答案:A
at now + 5 minutes 进入交互式输入,Ctrl-D 提交任务。
单选题
查看当前所有已启用的 systemd 服务单元文件状态,应使用
A. systemctl list-unit-files --type=service
B. systemctl is-active
C. systemctl list-units
D. systemctl status
正确答案:A
list-unit-files 显示单元文件的启用/禁用状态。
单选题
重启 firewalld 服务并设置为开机自启,正确的是
A. systemctl restart firewalld && systemctl enable firewalld
B. firewall-cmd --restart
C. service firewalld restart --enable
D. systemctl reboot firewalld
正确答案:A
systemctl restart/enable 分别管理服务的运行与开机自启。
单选题
在 RHEL 9 中安装软件包 httpd,推荐命令是
A. rpm -ivh httpd.rpm
B. yum install httpd
C. dnf install httpd
D. apt install httpd
正确答案:C
RHEL 8/9 默认包管理器为 dnf(yum 为其兼容别名);rpm 不自动解决依赖。
单选题
在 RHEL 9 中,httpd 服务默认监听的端口是?
A. 443
B. 80
C. 8443
D. 8080
正确答案:B
根据 IANA 与 RHEL 默认配置,HTTP 使用 TCP 80,HTTPS 使用 TCP 443;httpd 默认监听 80。
单选题
在 RHEL 9 中,要让 httpd 通过防火墙允许外部访问 HTTP,应执行哪条命令?
A. systemctl enable --now firewalld && firewall-cmd --add-service=http
B. firewall-cmd --add-port=80/tcp && firewall-cmd --reload
C. iptables -A INPUT -p tcp --dport 80 -j ACCEPT
D. firewall-cmd --add-service=http --permanent && firewall-cmd --reload
正确答案:D
firewalld 中预定义 http 服务对应 TCP 80;使用 --permanent 后必须 --reload 才生效。
单选题
在 RHEL 9 中,httpd 默认的 DocumentRoot 目录是?
A. /var/www
B. /var/www/html
C. /etc/httpd/htdocs
D. /usr/share/httpd
正确答案:B
httpd 默认配置文件 /etc/httpd/conf/httpd.conf 中 DocumentRoot 指向 /var/www/html。
进入「服务管理」专项练习 →
查看红帽认证全部题目 →