RHCSA测验

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

[root@localhost ~]# find / -name  "vsftpd*"
/usr/lib/python3.9/site-packages/sos/report/plugins/__pycache__/vsftpd.cpython-39.opt-1.pyc
/usr/lib/python3.9/site-packages/sos/report/plugins/__pycache__/vsftpd.cpython-39.pyc
/usr/lib/python3.9/site-packages/sos/report/plugins/vsftpd.py
/usr/share/doc/python3-pycurl/tests/vsftpd.conf
/mnt/AppStream/Packages/vsftpd-3.0.3-49.el9.x86_64.rpm
[root@localhost ~]# rpm -ivh /mnt/AppStream/Packages/vsftpd-3.0.3-49.el9.x86_64.rpm
warning: /mnt/AppStream/Packages/vsftpd-3.0.3-49.el9.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:vsftpd-3.0.3-49.el9              ################################# [100%]


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

[root@localhost ~]# rpm -qi vsftpd
Name        : vsftpd
Version     : 3.0.3
Release     : 49.el9
Architecture: x86_64
Install Date: Tue 28 Mar 2023 04:11:37 PM CST
Group       : Unspecified
Size        : 356096
License     : GPLv2 with exceptions
Signature   : RSA/SHA256, Wed 24 Nov 2021 07:31:28 PM CST, Key ID 199e2f91fd431d51
Source RPM  : vsftpd-3.0.3-49.el9.src.rpm
Build Date  : Tue 16 Nov 2021 07:17:01 PM CST
Build Host  : x86-vm-55.build.eng.bos.redhat.com
Packager    : Red Hat, Inc. 
Vendor      : Red Hat, Inc.
URL         : https://security.appspot.com/vsftpd.html
Summary     : Very Secure Ftp Daemon
Description :
vsftpd is a Very Secure FTP daemon. It was written completely from
scratch.


   3> 卸载软件包vsftpd。

[root@localhost ~]# rpm -evh vsftpd
Preparing...                          ################################# [100%]
Cleaning up / removing...
   1:vsftpd-3.0.3-49.el9              ################################# [100%]

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

[root@localhost ~]# mount /dev/cdrom /media
[root@localhost ~]# vim /etc/yum.repos.d/rhel.repo 

RHCSA测验_第1张图片2> 通过yum来安装traceroute。

[root@localhost yum.repos.d]# yum install traceroute
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

appstream-rhel9                                                                                                                                                                   3.1 MB/s | 3.2 kB     00:00    
baseos-rhel9                                                                                                                                                                      2.7 MB/s | 2.7 kB     00:00    
Dependencies resolved.
==================================================================================================================================================================================================================
 Package                                            Architecture                                   Version                                                   Repository                                      Size
==================================================================================================================================================================================================================
Installing:
 traceroute                                         x86_64                                         3:2.1.0-16.el9                                            baseos                                          61 k

Transaction Summary
==================================================================================================================================================================================================================
Install  1 Package

Total size: 61 k
Installed size: 108 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                          1/1 
  Installing       : traceroute-3:2.1.0-16.el9.x86_64                                                                                                                                                         1/1 
  Running scriptlet: traceroute-3:2.1.0-16.el9.x86_64                                                                                                                                                         1/1 
  Verifying        : traceroute-3:2.1.0-16.el9.x86_64                                                                                                                                                         1/1 
Installed products updated.

Installed:
  traceroute-3:2.1.0-16.el9.x86_64                                                                                                                                                                                

Complete!


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

[root@localhost yum.repos.d]# yum whatprovides ifconfig
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:01:21 ago on Tue 28 Mar 2023 04:59:04 PM CST.
net-tools-2.0-0.62.20160912git.el9.x86_64 : Basic networking tools
Repo        : @System
Matched from:
Filename    : /usr/sbin/ifconfig

net-tools-2.0-0.62.20160912git.el9.x86_64 : Basic networking tools
Repo        : baseos
Matched from:
Filename    : /usr/sbin/ifconfig


   4> 卸载软件包httpd。

root@localhost yum.repos.d]# yum remove -y traceroute
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Dependencies resolved.
==================================================================================================================================================================================================================
 Package                                            Architecture                                   Version                                                  Repository                                       Size
==================================================================================================================================================================================================================
Removing:
 traceroute                                         x86_64                                         3:2.1.0-16.el9                                           @baseos                                         108 k

Transaction Summary
==================================================================================================================================================================================================================
Remove  1 Package

Freed space: 108 k
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                          1/1 
  Erasing          : traceroute-3:2.1.0-16.el9.x86_64                                                                                                                                                         1/1 
  Running scriptlet: traceroute-3:2.1.0-16.el9.x86_64                                                                                                                                                         1/1 
  Verifying        : traceroute-3:2.1.0-16.el9.x86_64                                                                                                                                                         1/1 
Installed products updated.

Removed:
  traceroute-3:2.1.0-16.el9.x86_64                                                                                                                                                                                

Complete!

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

[root@localhost ~]# pgrep -l sshd
1060 sshd
1925 sshd
1954 sshd
[root@localhost ~]# pidof sshd
1954 1925 1060

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

[root@localhost ~]# nmcli connection modify ens160 ipv4.method manual ipv4.addresses 192.168.72.123/24 ipv4.gateway 192.168.72.2 ipv4.dns 114.114.114.114 autoconnect yesal ipv4.addresses 192.168.72.123/24 ipv4.gateway 192.168.72.2 ipv4.
[root@localhost ~]# wget https://mirrors.aliyun.com/gnu/wget/wget2-latest.tar.gz
--2023-03-28 17:24:20--  https://mirrors.aliyun.com/gnu/wget/wget2-latest.tar.gz
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 140.249.32.203, 140.249.32.207, 140.249.32.205, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|140.249.32.203|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3780748 (3.6M) [application/octet-stream]
Saving to: ‘wget2-latest.tar.gz’

wget2-latest.tar.gz                                  100%[====================================================================================================================>]   3.61M   443KB/s    in 8.4s    

2023-03-28 17:24:29 (439 KB/s) - ‘wget2-latest.tar.gz’ saved [3780748/3780748]

[root@localhost ~]# ls
1  a  anaconda-ks.cfg  files  test  tr.txt  wget2-latest.tar.gz

你可能感兴趣的:(linux,网络)