RHCSA第七天总结与练习

第九章

在这里插入图片描述

1、设置权限,要求如下:
(1)创建g1组,要求创建一个属于redhat用户g1组的文件redhat.txt

[root@localhost ~]# groupadd g1         //创建组g1
[root@localhost ~]# useradd redhat       //创建用户redhat
[root@localhost /]# mkdir redhat          
[root@localhost /]# cd redhat
[root@localhost redhat]# touch redhat.txt      //创建文件
[root@localhost redhat]# chown redhat redhat.txt  //将文件所属于用户
[root@localhost redhat]# chgrp g1 ./redhat.txt   //将文件所属于组

(2)新建/sc目录,所属组为group组,root用户和group组用户可在该目录下创建文件,其他人无任何权限

[root@localhost /]# mkdir /sc      //创建目录
[root@localhost /]# groupadd group   //创建组
[root@localhost /]# chgrp  group ./sc   //所属组
[root@localhost /]# chown -R 770 sc    //赋予权限

在这里插入图片描述

(3)新建/cw目录为财务部存储目录,只能对财务部人员可以写入,并且财务部人员所建立的文件都自动属于mygroup组中

[root@localhost /]# mkdir /cw    //创建目录
[root@localhost /]# groupadd mygroup   //创建组
[root@localhost /]# chgrp mygroup /cw   //所属组
[root@localhost /]# chmod -R g+wx /cw    //赋予权限

在这里插入图片描述

(4)设置 helen用户对于/sc和/cw目录可以读,写,执行

[root@localhost /]# setfacl -m u:helen:rwx /sc
[root@localhost /]# setfacl -m u:helen:rwx /cw

(5)设置/test目录为公共存储目录对所有用户可以读,写,执行,但用户只能删除属于自己的文件(t权限)

[root@localhost /]# chmod -R 1777 /test  

在这里插入图片描述

(6)在/test/dir里创建的新文件自动属于temp组

[root@localhost test]# groupadd temp
[root@localhost test]# chgrp temp /test/dir

在这里插入图片描述

第十章

在这里插入图片描述

1、配置网络
(1)为网卡添加一个会话static,在此会话配置ip地址为x.x.x.123

[root@localhost /]# nmcli c add type ethernet con-name static ifname ens160
[root@localhost /]# nmcli c modify static ipv4.addresses 192.168.2.123 
[root@localhost /]# nmcli c modify static ipv4.gateway 192.168.2.2 ipv4.dns 8.8.8.8

(2)测试网络连通性,看是否能够ping通百度,并把百度首页文件下载下来
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

(3)设置系统开机时,该网卡通过DHCP协议自动获取IP地址
使用vim工具进入到/etc/sysconfig/network-scripts/ifcfg-ens160文件里,修改最后一行ONBOOT,将no修改为yes

[root@localhost /]# vim /etc/sysconfig/network-scripts/ifcfg-ens160

在这里插入图片描述
在这里插入图片描述

第十一章

在这里插入图片描述

1、RPM软件管理
1)通过rpm安装vsftpd软件。

通过wget下载vsftpd包

[root@localhost /]# wget http://rpmfind.net/linux/opensuse/distribution/leap/15.5/repo/oss/x86_64/vsftpd-3.0.5-150400.3.3.1.x86_64.rpm

在这里插入图片描述

安装vsftpd,加入 --force --nodeps 可以强制安装

[root@localhost /]# rpm -ivh vsftpd-3.0.5-150400.3.3.1.x86_64.rpm.1 --force --nodeps

在这里插入图片描述
2)查询vsftpd软件包的信息。
在这里插入图片描述
3)卸载软件包vsftpd。
在这里插入图片描述

2、YUM软件管理
1)挂载本地光盘,配置yum源为rhel8.repo。

进入/etc/yum.repos.d/rhel8.repo文件,编写图片的内容

[root@localhost /]# vim /etc/yum.repos.d/rhel8.repo
[root@localhost /]# mount /dev/sr0 /mnt

在这里插入图片描述

2)通过yum来安装httpd。

[root@localhost /]# yum install httpd -y
[root@localhost /]# rpm -q httpd
httpd-2.4.37-39.module+el8.4.0+9658+b87b2deb.x86_64

3)使用yum查询ifconfig命令是由那个软件包提供的。
在这里插入图片描述

4)卸载软件包httpd。

[root@localhost /]# yum remove httpd

在这里插入图片描述

3、源码管理
下载tree源码包并编译安装。

下载源码包

[root@localhost /]# wget http://mama.indstate.edu/users/ice/tree/src/tree-1.7.0.tgz

在这里插入图片描述
解压

[root@localhost /]# tar zxvf tree-1.7.0.tgz

在这里插入图片描述
进入解压的目录,进行编译
在这里插入图片描述
在这里插入图片描述
安装成功
在这里插入图片描述

4、进程管理
1)通过ps命令的两种选项形式查看进程信息
在这里插入图片描述
在这里插入图片描述

2)通过pgrep和pidof命令查看sshd服务的进程号
在这里插入图片描述

3)使dd if=/dev/zero of=/root/file bs=1M count=8190 命令操作在前台运行
在这里插入图片描述
4)将上题操作调入到后台并暂停
在这里插入图片描述

5)使dd if=/dev/zero of=/root/file2 bs=1M count=1024 命令操作在后台运行
在这里插入图片描述
6)查看后台的任务列表
在这里插入图片描述

7)恢复dd if=/dev/zero of=/root/file bs=1M count=8190 让其在后台继续运行
在这里插入图片描述

8)查询dd if=/dev/zero of=/root/file bs=1M count=8190 命令的进程并通过kill杀死
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值