RHCSA第四次作业

文章详细介绍了如何使用RPM和YUM进行软件安装、查询和卸载,包括pgrep和pidof命令来查找sshd服务进程号,以及网络配置中添加IPv4地址和下载wget2包。此外,还涵盖了磁盘的分区和格式化,以及文件系统的挂载和文件创建。
摘要由CSDN通过智能技术生成

1、RPM软件管理
                        1> 通过rpm安装vsftpd软件。
                        2> 查询vsftpd软件包的信息。
                        3> 卸载软件包vsftpd。

2、YUM软件管理
                        1> 挂载本地光盘,配置yum源为rhel.repo。
                        2> 通过yum来安装traceroute。
                        3> 使用yum查询ifconfig命令是由那个软件包提供的。
                        4> 卸载软件包httpd。

3、通过pgrep和pidof命令查看sshd服务的进程号

4、配置网络:为网卡添加一个本网段IPV4地址,x.x.x.123,并启用,然后在阿里镜像站GNU里,下载wget2的包

5、1、基本存储配置

1) 添加一块10G大小的磁盘,将该磁盘分为两个主分区,大小为1G、2G。将剩余的空间全部划分为扩展分区。划分一个逻辑分区,大小为3G。(主分区文件系统类型为ext4,逻辑分区文件系统类型为xfs) 

2) 将三个分区分别挂载到/dir1、/dir2、/dir3。 

3) 在第一个主分区中创建一个文件为file1,内容为this is partition1。在第二个分区中创建一个文件为file2,内容为this is partition2。在第三个分区中创建一个文件为file3,内容为this is partition3

1、RPM软件管理

1> 通过rpm安装vsftpd软件。

[root@redhat Packages]# rpm -ivh vsftpd-3.0.3-49.el9.x86_64.rpm

2>查询vsftpd软件包的信息。

 [root@redhat Packages]# rpm -l vsftpd-3.0.3-49.el9.x86_64.rpm

 3> 卸载软件包vsftpd。

[root@redhat Packages]# rpm -evh vsftpd

 2、YUM软件管理

1> 挂载本地光盘,配置yum源为rhel.repo。

[root@redhat Packages]# cd /etc/yum.repos.d/

[root@redhat yum.repos.d]# vim rhel.repo

 2>通过yum来安装traceroute。

[root@redhat yum.repos.d]# yum install traceroute   

 -y

 3>使用yum查询ifconfig命令是由那个软件包提供的。

[root@redhat yum.repos.d]# yum provides ifconfig

4>卸载软件包httpd。

[root@redhat yum.repos.d]# yum remove httpd

 3.通过pgrep和pidof命令查看sshd服务的进程号

[root@redhat ~]# pgrep sshd

 [root@redhat ~]# pidof sshd

 4.配置网络:为网卡添加一个本网段IPV4地址,x.x.x.123,并启用,然后在阿里镜像站GNU里,下载wget2的包

(1).添加网址

[root@redhat ~]# nmcli c add type ethernet con-name ethx-test ifname ethx ipv4.addresses '192.168.224.123' ipv4.gateway 192.168.224.2 ipv4.dns '114.114.114.114' ipv4.method manual autoconnect yes

 (2).下载wget2

[root@redhat ~]# wget 

https://mirrors.aliyun.com/gnu/wget/wget2-latest.tar.lz?spm=a2c6h.25603864.0.0.7ccf37cdKw1zGA5、1、基本存储配置

 1) 添加一块10G大小的磁盘,将该磁盘分为两个主分区,大小为1G、2G。将剩余的空间全部划分为扩展分区。划分一个逻辑分区,大小为3G。(主分区文件系统类型为ext4,逻辑分区文件系统类型为xfs)

1.添加一块硬盘(10G)

 2.使用fdisk管理分区

[root@redhat ~]# fdisk  /dev/sda

1磁盘分为两个主分区,大小为1G、2G

 

 2将剩余的空间全部划分为扩展分区

 3划分一个逻辑分区,大小为3G

 (4)查看结果

 3.主分区文件系统类型为ext4

[root@redhat ~]# mkfs.ext4 /dev/sda1

[root@redhat ~]# mkfs.ext4 /dev/sda2

 4.逻辑分区文件系统类型为xfs

[root@redhat ~]# mkfs.xfs /dev/sda5

 2).将三个分区分别挂载到。

1. 创建dir1、dir2、dir3

 [root@redhat ~]# mkdir /dir{1..3}

2.挂载

[root@redhat ~]# mount /dev/sda1 /dir1

[root@redhat ~]# mount /dev/sda2 /dir2

[root@redhat ~]# mount /dev/sda5 /dir3

3.查看

 3).在第一个主分区中创建一个文件为file1,内容为this is partition1。在第二个分区中创建一个文件为file2,内容为this is partition2。在第三个分区中创建一个文件为file3,内容为this is partition3

[root@redhat ~]# echo "this is partition1"> /dir1/file1

 [root@redhat ~]# echo "this is partition2"> /dir2/file2

[root@redhat ~]# echo "this is partition3"> /dir3/file3

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值