ToB企服应用市场:ToB评测及商务社交产业平台

标题: 云计算专业期末RHEL8.6红帽网络操纵体系考试(实操) [打印本页]

作者: 用多少眼泪才能让你相信    时间: 2024-6-15 03:13
标题: 云计算专业期末RHEL8.6红帽网络操纵体系考试(实操)
云计算专业期末RHEL8.6红帽网络操纵体系考试



  

前言

本文介绍关于云计算专业期末RHEL8.6红帽操纵体系考试内容标题详解

一、假造机情况设置

一般情况下假造机中的体系是已经安装好的,但以防万一还是加上在假造机中体系安装的步调
1.确定镜像文件位置

(后缀为.iso的为镜像文件,下图这些文件都为iso镜像文件)

2. 在假造机主页中选择创建假造机


3. 选择典范(推荐)选项


4. 通过欣赏选择我们在第一步时确定的镜像文件


5. 填写用户名全名和暗码

(这里所填的用户名和暗码在接下来登录中需要使用到)

6. 确定假造机名称和假造机文件安装位置

(在考试中会需要到两台假造机,所以可以使用rhel-1和rhel-2名称或者server和client名称来区分)

7. 磁盘空间巨细和体系硬件设置我们保持默认即可满足要求

二、启动假造机至体系登陆界面

1.在正常情况下

假造机设置完成后会自行启动
2.未自行启动情况

三、体系底子设置内容及对应假造机情况部署

1. 主机名更改

  1. [test@localhost~]#hostnamectl set-hostname 主机名  #这里注意题目要求对应的主机名
  2. [test@localhost~]#bash  #刷新即可显示更改后的主机名
  3. [主机名@localhost~]
复制代码
2. 切换root管理员模式

  1. [test@localhost~]#su root
  2. password:  #这里的密码在考试时默认为123456,如果在虚拟机创建时配置过为之前配置的密码
  3. [root@localhost test]cd ~  #切换
  4. [root@localhost~]   #看到test用户变为root用户即为切换成功
复制代码
3.IP地址的设置

需要注意的是,由于更改体系设置需要root用户的权限,所以在操纵这一步时请务必确保当前为root用户
  1. [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens160
复制代码
按i进入编辑模式 此处网卡设置文件中的编辑器操纵模式在后面的编辑器操纵都是一样的
  1. TYPE=Ethernet
  2. PROXY_METHOD=none
  3. BROWSER_ONLY=no
  4. BOOTPROTO=dhcp  #此处改为static为静态地址
  5. DEFROUTE=yes
  6. IPV4_FAILURE_FATAL=no
  7. IPV6INIT=yes
  8. IPV6_AUTOCONF=yes
  9. IPV6_DEFROUTE=yes
  10. IPV6_FAILURE_FATAL=no
  11. IPV6_ADDR_GEN_MODE=stable-privacy
  12. NAME=enp0s3
  13. UUID=8257f116-d5e0-45f0-8c11-4b733f387d6f
  14. DEVICE=enp0s3
  15. ONBOOT=no  #此处改为on启用该网卡配置
  16. #下面为需要添加的内容
  17. IPADDR=192.168.56.2  #此处为IP地址,请根据题目具体更改
  18. GATEWAY=192.168.56.1  #此处为网关,请根据题目具体更改
  19. NETMASK=255.255.255.0  #此处为子网掩码,默认即可,如有要求可另行更改
  20.   "/etc/sysconfig/network-scripts/ifcfg-enp0s3" 19L, 347C
复制代码
编辑完按ESC,再输入:wq以保存退出
  1. [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33  
  2. #此处指令为检查刚刚的更改是否保存成功了,如果没有从第一行命令开始重新编辑保存
  3. TYPE=Ethernet
  4. PROXY_METHOD=none
  5. BROWSER_ONLY=no
  6. BOOTPROTO=static
  7. DEFROUTE=yes
  8. IPV4_FAILURE_FATAL=no
  9. IPV6INIT=yes
  10. IPV6_AUTOCONF=yes
  11. IPV6_DEFROUTE=yes
  12. IPV6_FAILURE_FATAL=no
  13. IPV6_ADDR_GEN_MODE=stable-privacy
  14. NAME=enp0s3
  15. UUID=8257f116-d5e0-45f0-8c11-4b733f387d6f
  16. DEVICE=enp0s3
  17. ONBOOT=on
  18. IPADDR=192.168.56.2
  19. GATEWAY=192.168.56.1
  20. NETMASK=255.255.255.0
  21. [root@localhost~]systemctl restart NetworkManager.service  #重启网卡
复制代码
下面需要注意截图IP地址设置
  1. [root@localhost ~]# ip a  #此处可检查重启网卡后的配置文件是否生效
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4.     inet 127.0.0.1/8 scope host lo
  5.        valid_lft forever preferred_lft forever
  6.     inet6 ::1/128 scope host
  7.        valid_lft forever preferred_lft forever
  8. 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
  9.     link/ether 08:00:27:0f:9d:e7 brd ff:ff:ff:ff:ff:ff
  10.     inet 192.168.56.2/24 brd 192.168.56.255 scope global noprefixroute enp0s3  #注意这一行
  11.     #是否出现了刚刚我们在配置文件中添加的IP地址
  12.     #如果没有请重新启动网卡或者回到第一行命令重新编辑保存
  13.        valid_lft forever preferred_lft forever
  14.     inet6 fe80::1819:9458:a80:e234/64 scope link noprefixroute
  15.        valid_lft forever preferred_lft forever
  16. 3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
  17.     link/ether 52:54:00:9a:6f:5d brd ff:ff:ff:ff:ff:ff
  18.     inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
  19.        valid_lft forever preferred_lft forever
  20. 4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
  21.     link/ether 52:54:00:9a:6f:5d brd ff:ff:ff:ff:ff:ff
复制代码
4.本地YUM源设置

1.首先在假造机的光驱中挂载上镜像文件
右键后点击设置

使用ISO镜像文件并选择文件目录

在假造机右下角确保光驱启动



2.回到下令行界面
  1. [root@localhost ~]# mkdir /opt/redhat
  2. [root@localhost ~]# mount -o loop /dev/sr0 /opt/redhat
  3. [root@localhost ~]# vi /etc/yum.repos.d/redhat.repo
复制代码
  1. #
  2. # Certificate-Based Repositories
  3. # Managed by (rhsm) subscription-manager
  4. #
  5. # *** This file is auto-generated.  Changes made here will be over-written. ***
  6. # *** Use "subscription-manager repo-override --help" if you wish to make changes. ***
  7. #
  8. # If this file is empty and this system is subscribed consider
  9. # a "yum repolist" to refresh available repos
  10. #
  11. [AppStream]
  12. name=appstream
  13. baseurl=file:///opt/redhat/AppStream
  14. gpgcheck=0
  15. enabled=1
  16. [BaseOS]
  17. name=baseos
  18. baseurl=file:///opt/redhat/BaseOS
  19. gpgcheck=0
  20. enabled=1
复制代码
下面需要注意截图YUM源设置
  1. [root@localhost ~]# yum repolist  #如果下面两行的repo name值成功出现appstream和baseos则为YUM源配置完成
  2. Updating Subscription Management repositories.
  3. Unable to read consumer identity
  4. This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
  5. Last metadata expiration check: 0:02:07 ago on Tue 26 Dec 2023 05:48:13 AM EST.
  6. repo id                                                repo name                                               status
  7. AppStream                                              appstream                                               4,795
  8. BaseOS                                                 baseos                                                  1,662
复制代码
四、六大服务设置

1.NFS(网络文件体系)

  1. [root@server ~]# cd
  2. [root@localhost ~]# dnf install nfs-utils  #检查NFS服务安装
  3. Updating Subscription Management repositories.
  4. Unable to read consumer identity
  5. This system is not registered with an entitlement server. You can use subscription-manager to register.
  6. Last metadata expiration check: 0:01:05 ago on Tue 26 Dec 2023 08:52:22 AM PST.
  7. Package nfs-utils-1:2.3.3-51.el8.x86_64 is already installed.
  8. Dependencies resolved.
  9. Nothing to do.
  10. Complete!
复制代码
防火墙设置

注意截图
  1. [root@localhost ~]# iptables -F  #防火墙配置
  2. [root@localhost ~]# iptables-save
  3. # Generated by iptables-save v1.8.4 on Tue Dec 26 09:05:21 2023
  4. *filter
  5. :INPUT ACCEPT [1447:1892001]
  6. :FORWARD ACCEPT [0:0]
  7. :OUTPUT ACCEPT [1418:949630]
  8. :LIBVIRT_INP - [0:0]
  9. :LIBVIRT_OUT - [0:0]
  10. :LIBVIRT_FWO - [0:0]
  11. :LIBVIRT_FWI - [0:0]
  12. :LIBVIRT_FWX - [0:0]
  13. COMMIT
  14. # Completed on Tue Dec 26 09:05:21 2023
  15. # Generated by iptables-save v1.8.4 on Tue Dec 26 09:05:21 2023
  16. *security
  17. :INPUT ACCEPT [1351:1880992]
  18. :FORWARD ACCEPT [0:0]
  19. :OUTPUT ACCEPT [1418:949630]
  20. COMMIT
  21. # Completed on Tue Dec 26 09:05:21 2023
  22. # Generated by iptables-save v1.8.4 on Tue Dec 26 09:05:21 2023
  23. *raw
  24. :PREROUTING ACCEPT [1452:1893361]
  25. :OUTPUT ACCEPT [1418:949630]
  26. COMMIT
  27. # Completed on Tue Dec 26 09:05:21 2023
  28. # Generated by iptables-save v1.8.4 on Tue Dec 26 09:05:21 2023
  29. *mangle
  30. :PREROUTING ACCEPT [1452:1893361]
  31. :INPUT ACCEPT [1447:1892001]
  32. :FORWARD ACCEPT [0:0]
  33. :OUTPUT ACCEPT [1418:949630]
  34. :POSTROUTING ACCEPT [1464:954880]
  35. :LIBVIRT_PRT - [0:0]
  36. -A POSTROUTING -j LIBVIRT_PRT
  37. -A LIBVIRT_PRT -o virbr0 -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill
  38. COMMIT
  39. # Completed on Tue Dec 26 09:05:21 2023
  40. # Generated by iptables-save v1.8.4 on Tue Dec 26 09:05:21 2023
  41. *nat
  42. :PREROUTING ACCEPT [60:7379]
  43. :INPUT ACCEPT [5:260]
  44. :POSTROUTING ACCEPT [264:20448]
  45. :OUTPUT ACCEPT [264:20448]
  46. :LIBVIRT_PRT - [0:0]
  47. -A POSTROUTING -j LIBVIRT_PRT
  48. -A LIBVIRT_PRT -s 192.168.122.0/24 -d 224.0.0.0/24 -j RETURN
  49. -A LIBVIRT_PRT -s 192.168.122.0/24 -d 255.255.255.255/32 -j RETURN
  50. -A LIBVIRT_PRT -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp -j MASQUERADE --to-ports 1024-65535
  51. -A LIBVIRT_PRT -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp -j MASQUERADE --to-ports 1024-65535
  52. -A LIBVIRT_PRT -s 192.168.122.0/24 ! -d 192.168.122.0/24 -j MASQUERADE
  53. COMMIT
  54. # Completed on Tue Dec 26 09:05:21 2023
  55. [root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=nfs
  56. success
  57. [root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=rpc-bind
  58. success
  59. [root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=mountd
  60. success
  61. [root@localhost ~]# firewall-cmd --reload
  62. success
复制代码
创建共享目录及分配权限

  1. [root@localhost ~]# mkdir /nfsfile  #创建共享目录及分配权限
  2. [root@localhost ~]# chmod -R 777 /nfsfile
  3. [root@localhost ~]# echo "welcome" > /nfsfile/readme
复制代码
NFS服务设置文件

  1. [root@localhost ~]# vim /etc/exports
  2. # 以下为文件编辑内容
  3. /nfsfile 192.168.*.*(rw,sync,root_squash)
  4. # IP地址请根据题目对应客户机(即第二台机)IP进行变更星号数字
复制代码
启动服务

  1. [root@localhost ~]# systemctl restart rpcbind
  2. [root@localhost ~]# systemctl enable rpcbind
  3. [root@localhost ~]# systemctl start nfs-server
  4. [root@localhost ~]# systemctl enable nfs-server
  5. Created symlink /etc/systemd/system/multi-user.target.wants/nfs-server.service → /usr/lib/systemd/system/nfs-server.service.
复制代码
在客户机上查抄并挂载

  1. [root@localhost ~]#showmount -e 192.168.60.129  #此处IP填写第一台虚拟机ip
  2. Export list for 192.168.60.129:
  3. /nfsfile 192.168.*.*
  4. [root@localhost ~]# mkdir /nfsfile
  5. [root@localhost ~]# mount -t nfs 192.168.60.129:/nfsfile /nfsfile  #此处IP填写第一台虚拟机ip
  6. [root@localhost ~]# df -h   #如成功此处注意截图!!!
  7. Filesystem               Size  Used Avail Use% Mounted on
  8. devtmpfs                 1.8G     0  1.8G   0% /dev
  9. tmpfs                    1.9G     0  1.9G   0% /dev/shm
  10. tmpfs                    1.9G  9.8M  1.8G   1% /run
  11. tmpfs                    1.9G     0  1.9G   0% /sys/fs/cgroup
  12. /dev/nvme0n1p3            18G  5.2G   13G  30% /
  13. /dev/nvme0n1p1           295M  188M  107M  64% /boot
  14. tmpfs                    371M   44K  371M   1% /run/user/0
  15. 192.168.60.129:/nfsfile   18G  5.3G   13G  30% /nfsfile  ##看到这一行出现第一台虚拟机ip则为该服务配置成功
复制代码
2.Samba(文件共享服务)

安装Samba及客户端程序

  1. [root@server ~]# cd
  2. [root@localhost ~]# dnf install samba #第一台虚拟机
  3. Is this ok [y/N]: y  #此处安装进程会暂停需要输入y以继续
  4. # 当看到Complete!为安装成功
  5. [root@localhost ~]# dnf install samba samba-client  #第二台虚拟机
  6. Is this ok [y/N]: y  #此处安装进程会暂停需要输入y以继续
  7. # 当看到Complete!为安装成功
复制代码
创建Samba用户

回到第一台假造机
  1. [root@localhost ~]# pdbedit -a -u root #root用户可改成题目需求的用户
  2. new password: # 此处写密码,可设置为123456
  3. retype new password:再次输入相同密码确认
  4. Unix username:        root
  5. NT username:
  6. Account Flags:        [U          ]
  7. User SID:             S-1-5-21-1401601119-1095323409-2156053322-1000
  8. Primary Group SID:    S-1-5-21-1401601119-1095323409-2156053322-513
  9. Full Name:            root
  10. Home Directory:       \\LOCALHOST\root
  11. HomeDir Drive:
  12. Logon Script:
  13. Profile Path:         \\LOCALHOST\root\profile
  14. Domain:               LOCALHOST
  15. Account desc:
  16. Workstations:
  17. Munged dial:
  18. Logon time:           0
  19. Logoff time:          Wed, 06 Feb 2036 07:06:39 PST
  20. Kickoff time:         Wed, 06 Feb 2036 07:06:39 PST
  21. Password last set:    Tue, 26 Dec 2023 09:38:05 PST
  22. Password can change:  Tue, 26 Dec 2023 09:38:05 PST
  23. Password must change: never
  24. Last bad password   : 0
  25. Bad password count  : 0
  26. Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
复制代码
创建共享目录

  1. [root@localhost ~]# mkdir /home/database
  2. [root@localhost ~]# chown -Rf root:root /home/database #更改权限,注意用户名是否对应上一步骤所创建的用户名
  3. [root@localhost ~]# semanage fcontext -a -t samba_share_t /home/database
  4. [root@localhost ~]# restorecon -Rv /home/database
  5. Relabeled /home/database from unconfined_u:object_r:user_home_dir_t:s0 to unconfined_u:object_r:samba_share_t:s0
复制代码
设置SELinux服务与计谋

  1. [root@localhost ~]# getsebool -a | grep samba
  2. samba_create_home_dirs --> off
  3. samba_domain_controller --> off
  4. samba_enable_home_dirs --> off  #注意此行的off状态
  5. samba_export_all_ro --> off
  6. samba_export_all_rw --> off
  7. samba_load_libgfapi --> off
  8. samba_portmapper --> off
  9. samba_run_unconfined --> off
  10. samba_share_fusefs --> off
  11. samba_share_nfs --> off
  12. sanlock_use_samba --> off
  13. tmpreaper_use_samba --> off
  14. use_samba_home_dirs --> off
  15. virt_use_samba --> off
  16. [root@localhost ~]# setsebool -P samba_enable_home_dirs on
复制代码
修改Samba主设置文件

  1. [root@localhost ~]# vim /etc/samba/smb.conf  #编辑配置文件
  2. #下面的内容添加至配置文件内
  3. [database]
  4.         comment = sharefile
  5.         path = /home/database
  6.         public = no
  7.         writable = yes
复制代码
防火墙设置

注意截图
  1. [root@localhost ~]# systemctl restart smb
  2. [root@localhost ~]# systemctl enable smb
  3. Created symlink /etc/systemd/system/multi-user.target.wants/smb.service → /usr/lib/systemd/system/smb.service.
  4. [root@localhost ~]# iptables -F
  5. [root@localhost ~]# iptables-save
  6. [root@localhost ~]# firewall-cmd --zone=public --permanent --add-service=samba
  7. success
  8. [root@localhost ~]# firewall-cmd --reload
  9. success
复制代码
客户端共享目录查抄

  1. [root@localhost ~]# dnf install cifs-utils
  2. Updating Subscription Management repositories.
  3. Unable to read consumer identity
  4. This system is not registered with an entitlement server. You can use subscription-manager to register.
  5. Last metadata expiration check: 0:19:29 ago on Tue 26 Dec 2023 09:34:47 AM PST.
  6. Package cifs-utils-6.8-3.el8.x86_64 is already installed.
  7. Dependencies resolved.
  8. Nothing to do.
  9. Complete!
  10. [root@localhost ~]# mkdir /database
  11. [root@localhost ~]# mount -t cifs -o username=root,password=123456 //192.168.60.129/database /database   
  12. #username为一开始创建samba使用的用户名
  13. #password为创建的密码
  14. #IP地址注意根据第一台虚拟机实际IP更改一下
  15. [root@localhost ~]# df -h  #此处注意截图
  16. Filesystem                 Size  Used Avail Use% Mounted on
  17. devtmpfs                   1.8G     0  1.8G   0% /dev
  18. tmpfs                     1.9G     0  1.9G   0% /dev/shm
  19. tmpfs                      1.9G  9.8M  1.8G   1% /run
  20. tmpfs                      1.9G     0  1.9G   0% /sys/fs/cgroup
  21. /dev/nvme0n1p3              18G  5.2G   13G  30% /
  22. /dev/nvme0n1p1             295M  188M  107M  64% /boot
  23. tmpfs                      371M   44K  371M   1% /run/user/0
  24. 192.168.60.129:/nfsfile     18G  5.3G   13G  30% /nfsfile
  25. /dev/loop0                  11G   11G     0 100% /opt/redhat
  26. //192.168.60.129/database   18G  5.3G   13G  30% /database #当看到这一行时为配置该服务成功
复制代码
3.DNS(域名解析服务)

安装bind服务程序

该服务后续教程中第一台假造机主机名更名为server,第二台更名为client,注意下令所对应的假造机
  1. [root@server ~]# cd
  2. [root@server ~]# dnf install bind-chroot
  3. Is this ok [y/N]: y  #此处安装进程会暂停需要输入y以继续
  4. # 当看到Complete!为安装成功
复制代码
修改主设置文件

  1. [root@server ~]# vim /etc/named.conf
  2. //
  3. // named.conf
  4. //
  5. // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
  6. // server as a caching only nameserver (as a localhost DNS resolver only).
  7. //
  8. // See /usr/share/doc/bind*/sample/ for example named configuration files.
  9. //
  10. options {
  11.         listen-on port 53 { any; };  #注意此行更改为any!!!
  12.         listen-on-v6 port 53 { ::1; };
  13.         directory       "/var/named";
  14.         dump-file       "/var/named/data/cache_dump.db";
  15.         statistics-file "/var/named/data/named_stats.txt";
  16.         memstatistics-file "/var/named/data/named_mem_stats.txt";
  17.         secroots-file   "/var/named/data/named.secroots";
  18.         recursing-file  "/var/named/data/named.recursing";
  19.         allow-query     { any; };  #注意此行更改为any!!!
复制代码
修改dns区域设置文件

  1. [root@server ~]# vim /etc/named.rfc1912.zones  #修改dns区域配置文件
  2. zone "szpt.com" IN {  #此处解析的域名需要根据题目需要更改
  3.         type master;
  4.         file "szpt.com.zone";  #此处是设置在named目录下dns的解析区域文件
  5.         allow-update { none; };
  6. };
复制代码
创建正向解析文件

  1. [root@server ~]# cd /var/named/  #切换目录
  2. [root@server named]# ls -al named.localhost
  3. -rw-r-----. 1 root named 152 Feb 16  2022 named.localhost
  4. [root@server named]# cp -a named.localhost szpt.com.zone #复制一份正向解析的模板文件
复制代码
  1. [root@server named]# vim szpt.com.zone
  2. ##注意下面的配置中,如果有标红说明配置错误了,注意检查!
  3. $TTL 1D
  4. @       IN SOA szpt.com. root.szpt.com. ( #DNS区域地址
  5.                                         0       ; serial
  6.                                         1D      ; refresh
  7.                                         1H      ; retry
  8.                                         1W      ; expire
  9.                                         3H )    ; minimum
  10. @       IN NS   ns.szpt.com. #域名服务器记录
  11. ns      IN A    192.168.86.129  #地址记录,指向dns服务器所在的IP地址,默认第一台虚拟机
  12. www     IN A    192.168.86.129  #地址记录,指向web服务器所在的IP地址,默认第一台虚拟机
  13. [root@server named]# systemctl restart named
  14. [root@server named]# systemctl enable named
  15. Created symlink /etc/systemd/system/multi-user.target.wants/named.service → /usr/lib/systemd/system/named.service.
复制代码
域名解析器设置文件

  1. [root@server ~]# cd
  2. [root@server ~]# vim /etc/resolv.conf
  3. # Generated by NetworkManager
  4. search localdomain
  5. nameserver 192.168.60.129 #第一台虚拟机IP地址
复制代码
防火墙设置

  1. [root@server named]# firewall-cmd --zone=public --permanent --add-service=dns
  2. success
  3. [root@server named]# firewall-cmd --reload
  4. success
  5. [root@server named]# systemctl restart named
复制代码
  1. [root@client ~]# nslookup  #注意截图!
  2. > 192.168.60.129 #第一台虚拟机IP地址
  3. 129.60.168.192.in-addr.arpa     name = dns.szpt.com.
  4. 129.60.168.192.in-addr.arpa     name = client.szpt.com.
  5. 129.60.168.192.in-addr.arpa     name = www.szpt.com.
  6. > www.szpt.com
  7. Server:         192.168.60.129
  8. Address:        192.168.60.129#53
复制代码
查抄服务

注意截图
  1. [root@server ~]# nslookup
  2. > www.szpt.com
  3. Server:         192.168.60.129
  4. Address:        192.168.60.129#53
  5. Name:   www.szpt.com
  6. Address: 192.168.60.129
  7. > ns.szpt.com
  8. Server:         192.168.60.129
  9. Address:        192.168.60.129#53
  10. Name:   ns.szpt.com
  11. Address: 192.168.60.129
复制代码
在主设置文件内添加反向解析参数

  1. [root@server ~]# vim /etc/named.rfc1912.zones
  2. zone "szpt.com" IN {
  3.         type master;
  4.         file "szpt.com.zone";
  5.         allow-update { none; };
  6. };
  7. ###下面为添加内容
  8. zone "60.168.192.in-addr.arpa" IN {
  9.         type master;
  10.         file "192.168.60.arpa";
  11.         allow-update {none;};
  12. };
复制代码
创建反向解析文件

  1. [root@server ~]# cd /var/named
  2. [root@server named]# cp -a named.loopback 192.168.60.arpa
  3. [root@server named]# vim 192.168.60.arpa
  4. $TTL 1D
  5. @       IN SOA  szpt.com. root.szpt.com. ( #对应题目更改需要反向解析的域名
  6.                                         0       ; serial
  7.                                         1D      ; refresh
  8.                                         1H      ; retry
  9.                                         1W      ; expire
  10.                                         3H )    ; minimum
  11.         NS      ns.szpt.com.
  12. ns      A       192.168.60.129
  13. 129  #注意为dns服务器第四段IP地址  IN PTR     www.szpt.com.
  14. 129   IN PTR     client.szpt.com. #解析的域名
  15. 129   IN PTR     dns.szpt.com.
  16. [root@server named]# systemctl restart named
  17. [root@server named]# nslookup
  18. > 192.168.60.129  #刚刚在反向解析中所写的IP地址,默认为第一台虚拟机IP地址
  19. 129.60.168.192.in-addr.arpa     name = client.szpt.com.
  20. 129.60.168.192.in-addr.arpa     name = dns.szpt.com.
  21. 129.60.168.192.in-addr.arpa     name = www.szpt.com.
复制代码
部署从服务器

  1. [root@server ~]# vim /etc/named.rfc1912.zones
  2. zone "szpt.com" IN {
  3.         type master;
  4.         file "szpt.com.zone";
  5.         allow-update { 192.168.60.130; };  #修改为第二台机的IP地址
  6. };
  7. zone "60.168.192.in-addr.arpa" IN {
  8.         type master;
  9.         file "192.168.60.arpa";
  10.         allow-update { 192.168.60.130; }; #修改为第二台机的IP地址
  11. };
  12. [root@server ~]# firewall-cmd --permanent --zone=public --add-service=dns
  13. Warning: ALREADY_ENABLED: dns
  14. success
  15. [root@server ~]# firewall-cmd --reload
  16. success
复制代码
  1. ### 此处切换为第二台虚拟机操作
  2. [root@client ~]# dnf install bind-chroot
  3. [root@client ~]# vim /etc/named.conf
  4. options {
  5.         listen-on port 53 { any; };  #此行修改为any
  6.         listen-on-v6 port 53 { ::1; };
  7.         directory       "/var/named";
  8.         dump-file       "/var/named/data/cache_dump.db";
  9.         statistics-file "/var/named/data/named_stats.txt";
  10.         memstatistics-file "/var/named/data/named_mem_stats.txt";
  11.         secroots-file   "/var/named/data/named.secroots";
  12.         recursing-file  "/var/named/data/named.recursing";
  13.         allow-query     { any; };   #此行修改为any
复制代码
  1. [root@client ~]# vim /etc/named.rfc1912.zones
  2. zone "szpt.com" IN {
  3.         type slave;
  4.         masters { 192.168.60.129; };
  5.         file "slaves/szpt.com.zone";
  6. };
  7. zone "129.168.192.in-addr.arpa" IN {
  8.         type slave;
  9.         masters { 192.168.60.129; };
  10.         file "slaves/192.168.60.arpa";
  11. };
  12. [root@client ~]# systemctl restart named
  13. [root@client slaves]# nslookup   #测试,看到如下则为成功
  14. > www.szpt.com
  15. Server:         192.168.60.129
  16. Address:        192.168.60.129#53
  17. Name:   www.szpt.com
  18. Address: 192.168.60.129
复制代码
4.DHCP(动态主机设置协议)

假造机情况设置

该服务后续教程中第一台假造机主机名更名为server,第二台更名为client,注意下令所对应的假造机
部署dhcpd服务程序

  1. [root@server ~]# cd
  2. [root@server ~]# dnf install -y dhcp-server
  3. Complete!  #看到此行即为安装成功
复制代码
注意如果标题提到了固定分配IP地址下一步调请跳转至“分配固定IP地址”步调开始操纵
设置dhcpd主设置文件

  1. #[root@server ~]# vim /etc/dhcp/dhcpd.conf
  2. ####注意下列dhcpd配置文件请务必严格格式编写,务必记住语句最后一句为分号结束
  3. # DHCP Server Configuration file.
  4. #   see /usr/share/doc/dhcp-server/dhcpd.conf.example
  5. #   see dhcpd.conf(5) man page
  6. #
  7. ddns-update-style none;  #设置dns服务器不进行自动动态更新
  8. ignore client-updates;
  9. subnet 192.168.60.0 netmask 255.255.255.0 {  #作用网段,请根据题目给出的网段具体更改,例IP地址前三段
  10.         range 192.168.60.50 192.168.60.150;  #IP地址池,根据题目给出的范围具体更改,例第四段地址范围
  11.         option subnet-mask 255.255.255.0;  
  12.         option routers 192.168.60.1;  #定义客户端的网关地址
  13.         option domain-name "szpt.com"; #定义搜索域,可以在指定域中分配IP
  14.         option domain-name-servers 192.168.60.1;  #定义客户端的DNS地址
  15.         default-lease-time 21600;
  16.         max-lease-time 43200;
  17. }
  18. [root@localhost ~]# systemctl start dhcpd
  19. [root@localhost ~]# systemctl enable dhcpd
  20. Created symlink /etc/systemd/system/multi-user.target.wants/dhcpd.service → /usr/lib/systemd/system/dhcpd.service.
复制代码
防火墙设置

注意截图
  1. [root@server ~]# firewall-cmd --zone=public --permanent --add-service=dhcp
  2. success
  3. [root@server ~]# firewall-cmd --reload
  4. success
复制代码
注意下面的假造机变更情况!!!
  1. [root@client ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens160
  2. TYPE=Ethernet
  3. PROXY_METHOD=none
  4. BROWSER_ONLY=no
  5. BOOTPROTO=dhcp  #注意此行参数应确保为dhcp
  6. DEFROUTE=yes
  7. IPV4_FAILURE_FATAL=no
  8. IPV6INIT=yes
  9. IPV6_AUTOCONF=yes
  10. IPV6_DEFROUTE=yes
  11. IPV6_FAILURE_FATAL=no
  12. NAME=ens160
  13. UUID=4da7a282-5177-4f6b-9746-2cd3b239b0eb
  14. DEVICE=ens160
  15. ONBOOT=yes  #注意此行参数应确保为yes
  16. [root@client ~]# reboot
  17. [root@client ~]# ip a  #注意截图,如此处IP
  18. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
  19.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  20.     inet 127.0.0.1/8 scope host lo
  21.        valid_lft forever preferred_lft forever
  22.     inet6 ::1/128 scope host
  23.        valid_lft forever preferred_lft forever
  24. 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
  25.     link/ether 00:0c:29:34:a2:2b brd ff:ff:ff:ff:ff:ff
  26.     inet 192.168.60.130/24 brd 192.168.60.255 scope global dynamic noprefixroute ens160
  27.        valid_lft 21437sec preferred_lft 21437sec  ##注意此处获取的IP应为dhcpd服务分配的IP地址,注意截图
  28.     inet6 fe80::20c:29ff:fe34:a22b/64 scope link noprefixroute
  29.        valid_lft forever preferred_lft forever
  30. 3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
  31.     link/ether 52:54:00:72:57:75 brd ff:ff:ff:ff:ff:ff
复制代码
分配固定IP地址情况(标题极大概率)

  1. [root@localhost ~]# ip a
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4.     inet 127.0.0.1/8 scope host lo
  5.        valid_lft forever preferred_lft forever
  6.     inet6 ::1/128 scope host
  7.        valid_lft forever preferred_lft forever
  8. 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
  9.     link/ether 00:0c:29:34:a2:2b brd ff:ff:ff:ff:ff:ff  #“00:0c:29:34:a2:2b”为第二台虚拟机MAC地址,在接下来会用到,请根据实际MAC地址记录
  10.     inet 192.168.60.130/24 brd 192.168.60.255 scope global dynamic noprefixroute ens160
  11.        valid_lft 21437sec preferred_lft 21437sec
  12.     inet6 fe80::20c:29ff:fe34:a22b/64 scope link noprefixroute
  13.        valid_lft forever preferred_lft forever
  14. 3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
  15.     link/ether 52:54:00:72:57:75 brd ff:ff:ff:ff:ff:ff
复制代码
  1. [root@server ~]# vim /etc/dhcp/dhcpd.conf
  2. #
  3. # DHCP Server Configuration file.
  4. #   see /usr/share/doc/dhcp-server/dhcpd.conf.example
  5. #   see dhcpd.conf(5) man page
  6. #
  7. ddns-update-style none;  #设置dns服务器不进行自动动态更新
  8. ignore client-updates;
  9. subnet 192.168.60.0 netmask 255.255.255.0 {  #作用网段,请根据题目给出的网段具体更改,例IP地址前三段
  10.         range 192.168.60.50 192.168.60.150;  #IP地址池,根据题目给出的范围具体更改,例第四段地址范围
  11.         option subnet-mask 255.255.255.0;  
  12.         option routers 192.168.60.1;  #定义客户端的网关地址
  13.         option domain-name "szpt.com"; #定义搜索域,可以在指定域中分配IP
  14.         option domain-name-servers 192.168.60.1;  #定义客户端的DNS地址
  15.         default-lease-time 21600;
  16.         max-lease-time 43200;
  17.         host root { #主机名称
  18.                            hardware ethernet 00:0c:29:34:a2:2b; #第二台虚拟机网卡的MAC地址
  19.                            fixed-address 192.168.60.131;  #指定的IP地址,根据题目要求情况变更
  20.                           }
  21. }
  22. [root@server ~]# systemctl restart dhcpd
  23. ```powershell
  24. [root@client ~]# reboot
  25. [root@client ~]# ip a  #此处注意截图!!!
  26. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
  27.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  28.     inet 127.0.0.1/8 scope host lo
  29.        valid_lft forever preferred_lft forever
  30.     inet6 ::1/128 scope host
  31.        valid_lft forever preferred_lft forever
  32. 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
  33.     link/ether 00:0c:29:34:a2:2b brd ff:ff:ff:ff:ff:ff
  34.     inet 192.168.60.131/24 brd 192.168.60.255 scope global dynamic noprefixroute ens160
  35.        valid_lft 21561sec preferred_lft 21561sec #注意此行IP地址已经变化了,说明成功分配到固定IP,截图!
  36.     inet6 fe80::20c:29ff:fe34:a22b/64 scope link noprefixroute
  37.        valid_lft forever preferred_lft forever
  38. 3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
  39.     link/ether 52:54:00:72:57:75 brd ff:ff:ff:ff:ff:ff
  40.     inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
  41.        valid_lft forever preferred_lft forever
复制代码
5.Apache(Web服务程序)

安装服务并启动

  1. [root@server ~]# cd
  2. [root@server ~]# dnf install httpd
  3. Is this ok [y/N]: y  #此处安装进程会暂停需要输入y以继续
  4. # 当看到Complete!为安装成功
  5. [root@server ~]# systemctl start httpd
  6. [root@server ~]# systemctl enable httpd
  7. Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
复制代码
服务启动测试

  1. [root@server ~]# firefox
复制代码
欣赏器输入IP地址127.0.0.1,如看到下图则为通过测试

  1. [root@server ~]# mkdir /home/wwwroot
  2. [root@server ~]# echo "the new web directory" > /home/wwwroot/index.html
  3. [root@server ~]# vim /etc/httpd/conf/httpd.conf
  4. #在配置中找到下列参数进行更改
  5. DocumentRoot "/home/wwwroot"  #122行
  6. #
  7. # Relax access to content within /var/www.
  8. #
  9. <Directory "/home/wwwroot"> #127行
  10.     AllowOverride None
  11.     # Allow open access:
  12.     Require all granted
  13. </Directory>
  14. # Further relax access to the default document root:
  15. <Directory "/home/wwwroot"> #134行
  16. [root@server ~]# systemctl restart httpd
  17. [root@server ~]# firefox
复制代码
欣赏器输入IP地址127.0.0.1,如看到下图则为通过测试

添加安全条文

回到下令行
  1. [root@server ~]# semanage fcontext -a -t httpd_sys_content_t /home/wwwroot
  2. [root@server ~]# semanage fcontext -a -t httpd_sys_content_t /home/wwwroot/*
  3. [root@server ~]# restorecon -Rv /home/wwwroot/
  4. Relabeled /home/wwwroot from unconfined_u:object_r:user_home_dir_t:s0 to unconfined_u:object_r:httpd_sys_content_t:s0
  5. Relabeled /home/wwwroot/index.html from unconfined_u:object_r:user_home_t:s0 to unconfined_u:object_r:httpd_sys_content_t:s0
  6. [root@server ~]# firefox
复制代码
欣赏器输入IP地址127.0.0.1,如看到下图则为通过测试

个人用户主页功能实现

  1. [root@server ~]# vim /etc/httpd/conf.d/userdir.conf
  2. #
  3. # UserDir: The name of the directory that is appended onto a user's home
  4. # directory if a ~user request is received.
  5. #
  6. # The path to the end user account 'public_html' directory must be
  7. # accessible to the webserver userid.  This usually means that ~userid
  8. # must have permissions of 711, ~userid/public_html must have permissions
  9. # of 755, and documents contained therein must be world-readable.
  10. # Otherwise, the client will only receive a "403 Forbidden" message.
  11. #
  12. <IfModule mod_userdir.c>
  13.     #
  14.     # UserDir is disabled by default since it can confirm the presence
  15.     # of a username on the system (depending on home directory
  16.     # permissions).
  17.     #
  18.     #UserDir disabled #在这一行前添加#号
  19.     #
  20.     # To enable requests to /~user/ to serve the user's public_html
  21.     # directory, remove the "UserDir disabled" line above, and uncomment
  22.     # the following line instead:
  23.     #
  24.     UserDir public_html  #将这一行的#号删除
  25. </IfModule>
  26. #
  27. # Control access to UserDir directories.  The following is an example
  28. # for a site where these directories are restricted to read-only.
  29. #
  30. <Directory "/home/*/public_html">
  31.     AllowOverride FileInfo AuthConfig Limit Indexes
  32.     Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
  33.     Require method GET POST OPTIONS
  34. </Directory>
复制代码
  1. [root@server ~]# cd /home
  2. [root@server home]# su - test
  3. Last login: Thu Dec 28 17:06:12 PST 2023 on pts/1
  4. [test@server ~]$ mkdir public_html
  5. [test@server ~]$ echo "this is my website" > public_html/index.html  #编写个人网页展示内容
  6. [test@server ~]$ chmod -R 755 /home/test  #更改权限
  7. [test@server ~]$ exit
  8. logout
  9. [root@server home]# cd
  10. [root@server ~]# systemctl restart httpd
  11. [root@server ~]# setsebool -P httpd_enable_homedirs=on
  12. [root@server ~]# firefox
复制代码
欣赏器输入IP地址192.168.60.129/~test 或者127.0.0.1/~test,如看到下图则为通过测试 #IP地址为第一台假造机IP地址

为网站添加暗码

  1. [root@server ~]# htpasswd -c /etc/httpd/passwd test  #这里使用的是test用户
  2. New password: #输入网页登录的密码,密码为123456
  3. Re-type new password: #重新输入相同密码确认,123456
  4. Adding password for user test
  5. [root@server ~]# vim /etc/httpd/conf.d/userdir.conf
  6. #
  7. # Control access to UserDir directories.  The following is an example
  8. # for a site where these directories are restricted to read-only.
  9. #
  10. <Directory "/home/*/public_html">   ##更改下列参数如下
  11.     AllowOverride all
  12.     authuserfile "/etc/httpd/passwd" #验证文件路径
  13.     authname "privately website" #提示信息
  14.     authtype basic #密码模式
  15.     require user tset  #登录用户
  16. </Directory>
  17. [root@server ~]# systemctl restart httpd
  18. [root@server ~]# firefox
复制代码
此时就可以看到如下的登录界面,此处注意截图
登录账户为test,暗码为123456

基于IP地址进行访问

  1. [root@server ~]# mkdir -p /home/wwwroot/10[root@server ~]# mkdir -p /home/wwwroot/20[root@server ~]# mkdir -p /home/wwwroot/30[root@server ~]# echo "ip10" > /home/wwwroot/10/index.html[root@server ~]# echo "ip20" > /home/wwwroot/20/index.html[root@server ~]# echo "ip30" > /home/wwwroot/30/index.html[root@server ~]# vim /etc/httpd/conf/httpd.conf###添加至文件中大致132行处<VirtualHost 192.168.60.10> ###此处IP地址根据标题要求更改,或仿照教程第四段IP地址即可  ServerName www.test.com  DocumentRoot /home/wwwroot/10    <Directory /home/wwwroot/10>    AllowOverride None    Require all granted    </Directory></VirtualHost><VirtualHost 192.168.60.20> ###此处IP地址根据标题要求更改,或仿照教程第四段IP地址即可  ServerName www.test.com  DocumentRoot /home/wwwroot/20    <Directory /home/wwwroot/20>    AllowOverride None    Require all granted    </Directory></VirtualHost><VirtualHost 192.168.60.30> ###此处IP地址根据标题要求更改,或仿照教程第四段IP地址即可  ServerName www.test.com  DocumentRoot /home/wwwroot/30    <Directory /home/wwwroot/30>    AllowOverride None    Require all granted    </Directory></VirtualHost>[root@server ~]# systemctl restart httpd[root@server ~]# firefox
  2. ###打开后输入以上差别的IP地址来查抄页面并截图
复制代码
基于主机域名进行访问

  1. [root@server ~]# mkdir -p /var/www/html/web1[root@server ~]# mkdir -p /var/www/html/web2[root@server ~]# echo "web1" > /var/www/html/web2/index.html[root@server ~]# echo "web2" > /var/www/html/web2/index.html[root@server ~]# vim /etc/httpd/conf/httpd.conf[root@server ~]# vim /etc/httpd/conf/httpd.conf<virtualhost 192.168.60.129> #为第一台假造机IP地址  documentroot /var/www/html/web1  servername www.web1.com</virtualhost><virtualhost 192.168.60.129> #为第一台假造机IP地址  documentroot /var/www/html/web2  servername www.web2.com</virtualhost>[root@server ~]# systemctl restart httpd[root@server ~]# firefox
  2. ###打开后输入网址www.web1.com和web2查抄页面并截图
复制代码
6. FTP(文件传输协议)

基本设置(防火墙)

  1. [root@server ~]# dnf install vsftpd
  2. [root@server ~]# iptables -F
  3. [root@server ~]# iptables-save
  4. [root@server ~]# firewall-cmd --permanent --zone=public --add-service=ftp
  5. success
  6. [root@server ~]# firewall-cmd --reload
  7. success
  8. [root@server ~]# setsebool -P ftpd_full_access=on   #SE策略
  9. [root@server ~]# mv /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf_bak
  10. [root@server ~]# grep -v "#" /etc/vsftpd/vsftpd.conf_bak > /etc/vsftpd/vsftpd.conf
复制代码
  1. ### 第二台虚拟机操作
  2. [root@client slaves]# dnf install ftp
复制代码
匿名模式

  1. [root@server ~]# vim /etc/vsftpd/vsftpd.conf
  2. anonymous_enable=YES
  3. anon_umask=022
  4. anon_upload_enable=YES
  5. anon_mkdir_write_enable=YES
  6. anon_other_write_enable=YES
  7. ### 添加以上五项
  8. local_enable=YES
  9. write_enable=YES
  10. local_umask=022
  11. dirmessage_enable=YES
  12. xferlog_enable=YES
  13. connect_from_port_20=YES
  14. xferlog_std_format=YES
  15. listen=NO
  16. listen_ipv6=YES
  17. pam_service_name=vsftpd
  18. userlist_enable=YES
  19. [root@server ~]# ls -ld /var/ftp/pub/
  20. drwxr-xr-x. 2 root root 6 Jan  7  2022 /var/ftp/pub/
  21. [root@server ~]# chown -R ftp /var/ftp/pub/
  22. [root@server ~]# ls -ld /var/ftp/pub/
  23. drwxr-xr-x. 2 ftp root 6 Jan  7  2022 /var/ftp/pub/
  24. [root@server ~]# systemctl restart vsftpd
  25. [root@server ~]# systemctl enable vsftpd
  26. Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.
复制代码
  1. ###客户机测试
  2. [root@client /]# ftp 192.168.60.129 #为第一台虚拟机IP地址
  3. Connected to 192.168.60.129 (192.168.60.129).
  4. 220 (vsFTPd 3.0.3)
  5. Name (192.168.60.129:root): anonymous
  6. 331 Please specify the password.
  7. Password: #此处回车即可
  8. 230 Login successful.
  9. Remote system type is UNIX.
  10. Using binary mode to transfer files.
  11. ftp>       ###注意截图
复制代码
本地用户模式

  1. [root@server ~]# vim /etc/vsftpd/vsftpd.conf
  2. ### 改为以下相同配置
  3. anonymous_enable=NO
  4. local_enable=YES
  5. write_enable=YES
  6. local_umask=022
  7. dirmessage_enable=YES
  8. xferlog_enable=YES
  9. connect_from_port_20=YES
  10. xferlog_std_format=YES
  11. listen=NO
  12. listen_ipv6=YES
  13. pam_service_name=vsftpd
  14. userlist_enable=YES
复制代码
用户名单设置

  1. [root@server ~]# vi /etc/vsftpd/user_list
  2. # vsftpd userlist
  3. # If userlist_deny=NO, only allow users in this file
  4. # If userlist_deny=YES (default), never allow users in this file, and
  5. # do not even prompt for a password.
  6. # Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
  7. # for users that are denied.
  8. root ###删去此行
  9. bin
  10. daemon
  11. adm
  12. lp
  13. sync
  14. shutdown
  15. halt
  16. mail
  17. news
  18. uucp
  19. operator
  20. games
  21. nobody
  22. [root@server ~]# vi /etc/vsftpd/ftpusers
  23. # Users that are not allowed to login via ftp
  24. root ###删去此行
  25. bin
  26. daemon
  27. adm
  28. lp
  29. sync
  30. shutdown
  31. halt
  32. mail
  33. news
  34. uucp
  35. operator
  36. games
  37. nobody
复制代码
防火墙设置

  1. [root@server ~]# setsebool -P ftpd_full_access=on
  2. [root@server ~]# systemctl restart vsftpd
  3. [root@server ~]# systemctl enable vsftpd
复制代码
客户机测试

  1. [root@client ~]# ftp 192.168.60.129 #为第一台虚拟机IP地址
  2. Connected to 192.168.60.129 (192.168.60.129).
  3. 220 (vsFTPd 3.0.3)
  4. Name (192.168.60.129:root): root
  5. 331 Please specify the password.
  6. Password: # 默认密码为123456
  7. 230 Login successful.
  8. Remote system type is UNIX.
  9. Using binary mode to transfer files.
  10. ftp> mkdir files #
  11. 550 Create directory operation failed.
  12. ftp> rename files database #
  13. 350 Ready for RNTO.
  14. 250 Rename successful.
  15. ftp> rmdir database #
  16. 250 Remove directory operation successful.
  17. ftp>
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4