Liunx 第6套练习
Liunx 第6套练习。
相关图书:《Linux网络操作系统项目教程》-中国工信出版集团、人民邮电出版社-杨云-ISBN9787115673602
印次:2025年8月第 1 次
以下执行命令之后的输出仅供参考,不一定完全与示例内容一致!
本套试题都在管理员权限下操作!
上机实操在 /usr/soft 目录下一次性创建嵌套目录 nginx/conf/logs 的命令
[root@localhost ~]# mkdir -p /usr/soft/nginx/conf/logs
[root@localhost ~]# ls -R /usr/soft
/usr/soft:
nginx
/usr/soft/nginx:
conf
/usr/soft/nginx/conf:
logs
/usr/soft/nginx/conf/logs:
上机实操在 /usr/soft/nginx/conf 目录创建 nginx.bak 文件并设置权限为 640 的权限命令
[root@localhost ~]# touch /usr/soft/nginx/conf/nginx.bak
[root@localhost ~]# chmod 640 /usr/soft/nginx/conf/nginx.bak
[root@localhost ~]# ls -l /usr/soft/nginx/conf
总用量 0
drwxr-xr-x. 2 root root 6 6月 24 23:59 logs
-rw-r-----. 1 root root 0 6月 25 00:00 nginx.bak
640权限为:-rw-r-----
上机实操保留文件所有属性,将文件备份复制的参数
[root@localhost ~]# cp -p /etc/resolv.conf /usr/soft/nginx/conf/logs/
[root@localhost ~]# ls -l /etc/resolv.conf
-rw-r--r--. 1 root root 73 6月 12 21:28 /etc/resolv.conf
[root@localhost ~]# ls -l /usr/soft/nginx/conf/logs/resolv.conf
-rw-r--r--. 1 root root 73 6月 12 21:28 /usr/soft/nginx/conf/logs/resolv.conf
原说明中的 /usr/soft/nginx/logs/ 路径有误,应为 /usr/soft/nginx/conf/logs/
上机实操查找 /var/log 目录下所有后缀为 .log 的日志文件命令
[root@localhost ~]# find /var/log -name "*.log"
/var/log/sssd/sssd_kcm.log
/var/log/audit/audit.log
/var/log/tuned/tuned.log
/var/log/tuned/tuned-ppd.log
/var/log/anaconda/anaconda.log
上机实操创建用户并指定用户 UID 的参数
[root@localhost ~]# useradd -u 1010 -s /bin/bash webuser
[root@localhost ~]# id webuser
用户id=1010(webuser) 组id=1010(webuser) 组=1010(webuser)
上机实操设置用户密码最短使用期限为7天的命令
[root@localhost ~]# chage -m 7 webuser
[root@localhost ~]# chage -l webuser
最近一次密码修改时间 :6月 24, 2026
密码过期时间 :从不
密码失效时间 :从不
帐户过期时间 :从不
两次改变密码之间相距的最小天数 :7
两次改变密码之间相距的最大天数 :99999
在密码过期之前警告的天数 :7
上机实操查看系统主机名配置文件的命令
[root@localhost ~]# cat /etc/hostname
[root@localhost ~]#
上机实操测试外网连通性,持续 ping 百度域名5次的命令
[root@localhost ~]# ping -c 5 www.baidu.com
PING www.a.shifen.com (157.148.69.186) 56(84) 比特的数据。
64 比特,来自 157.148.69.186 (157.148.69.186): icmp_seq=1 ttl=128 时间=152 毫秒
64 比特,来自 157.148.69.186 (157.148.69.186): icmp_seq=2 ttl=128 时间=50.1 毫秒
64 比特,来自 157.148.69.186 (157.148.69.186): icmp_seq=3 ttl=128 时间=88.1 毫秒
64 比特,来自 157.148.69.186 (157.148.69.186): icmp_seq=4 ttl=128 时间=240 毫秒
64 比特,来自 157.148.69.186 (157.148.69.186): icmp_seq=5 ttl=128 时间=179 毫秒
--- www.a.shifen.com ping 统计 ---
已发送 5 个包, 已接收 5 个包, 0% packet loss, time 4008ms
rtt min/avg/max/mdev = 50.074/141.773/239.600/66.888 ms
单选
答题设置
判断
答题设置
实操简答
答题设置
实操复现
答题设置
- Linux磁盘挂载与系统资源监控实操复现
上机打开 CentOS 终端,独立完成全套实操:
①人性化查看系统磁盘及文件系统类型
②创建目录并临时挂载光盘设备
③静态查看一次系统 CPU 与内存负载
④批量结束 nginx 所有进程
留存每一步实操截图。请详细写出实操步骤、对应命令及实操结果。
- Linux静态网络配置与本地解析实操复现
上机基于 CentOS 系统,独立完成全套实操:
①编辑网卡文件配置永久静态 IP、网关、DNS
②重启网络服务并验证配置生效
③配置本地 hosts 域名映射
④测试外网 5 次连通性
完整留存实操与复测截图。请详细写出实操步骤、对应命令及实操结果。
实操项目
- 完成多层嵌套目录创建、文件权限修改、属性保留复制、指定类型日志文件查找,操作无报错、结果有效。
参考Liunx 第5套练习:实操简答 第 1 题
- 完成指定 UID 业务用户创建、用户组配置、密码最短周期设置、可登录用户查询,验证权限配置生效
可登录用户查询:grep '/bin/bash$' /etc/passwd
验证权限配置:chage -l
- 实操查看磁盘文件系统信息、临时挂载光盘设备、监控系统资源负载、批量终止同名进程,熟练掌握运维命令
参考Liunx 第3套练习:查看系统块设备信息、查看当前系统所有挂载点详细信息
参考Liunx 第3套练习:临时挂载光盘镜像到 /media/cdrom,只读挂载,验证挂载成功
参考Liunx 第3套练习:动态监控系统进程,筛选出 cpu 占用最高的进程
参考Liunx 第3套练习:查询系统中所有包含 ssh 的进程,优雅终止所有 ssh 相关进程
- 配置永久静态IP与DNS、重启网络验证、配置本地域名映射、外网连通性测试,保障网络配置稳定生效
参考Liunx 第2套练习:永久配置网卡静态-ip网关dns设置开机自启并验证
- 安装 rpcbind 依赖服务、自定义网站首页、更新YUM缓存、查询软件、永久放行ftp防火墙端口,优化服务安全配置
安装 rpcbind 依赖服务:yum install -y rpcbind
参考Liunx 第3套练习:重置 httpd 默认首页,自定义网页内容为“考试专用服务页面”,重启服务验证
更新 YUM 缓存:yum clean all && yum makecache
参考Liunx 第5套练习:查询系统中是否已安装 vsftpd 软件,写出查询命令
永久放行 ftp 防火墙端口:
firewall-cmd --permanent --add-port=21/tcp
sudo firewall-cmd --reload