LINUX620 NFS
NFS解决方案
环境配置
主机名设置
.10 web.cn
[root@code caozx26]# hostnamectl set-hostname web.cn
[root@code caozx26]# hostname
web.cn
3 nfs.cn
[caozx26@localhost ~]$ hostname
localhost.localdomain
[caozx26@localhost ~]$ hostnamectl set-hostname nfs.cn
==== AUTHENTICATING FOR org.freedesktop.hostname1.set-static-hostname ===
Authentication is required to set the statically configured local host name, as well as the pretty host name.
Authenticating as: caozx26
Password:
==== AUTHENTICATION COMPLETE ===
[caozx26@localhost ~]$ hostname
hostname
nfs.cn
.100 backup.cn
[root@backup ~]# hostname
backup.itcast.cn
[root@backup ~]# hostnamectl set-hostname nfs.cn
[root@backup ~]# hostname
nfs.cn
[root@backup ~]# hostnamectl set-hostname backup.cn
[root@backup ~]# hostname
backup.cn
防火墙 selinux
web
[root@code caozx26]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)
[root@code caozx26]# systemctl stop firewalld
[root@code caozx26]# systemctl disable firewalld
[root@code caozx26]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)
[root@code caozx26]# setenforece 0
bash: setenforece: 未找到命令...
[root@code caozx26]# setenforce 0
[root@code caozx26]# cd /etc
[root@code etc]# cd selinux
[root@code selinux]# cat config# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disable
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted[root@code selinux]# vim config
[root@code selinux]# cat config# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
nfs
[root@nfs caozx26]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)5月 10 05:13:51 localhost.localdomain systemd[1]: Starting firewalld - dyna...
5月 10 05:13:52 localhost.localdomain systemd[1]: Started firewalld - dynam...
5月 10 05:13:53 localhost.localdomain firewalld[828]: WARNING: AllowZoneDri...
5月 10 08:41:22 localhost.localdomain systemd[1]: Stopping firewalld - dyna...
5月 10 08:41:26 localhost.localdomain systemd[1]: Stopped firewalld - dynam...
Hint: Some lines were ellipsized, use -l to show in full.
[root@nfs caozx26]# setenforce 0
[root@nfs caozx26]# cat /etc/selinux/config# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
backup
[root@backup ~]# cat /etc/selinux/config# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disable
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted[root@backup ~]# vim /etc/selinux/config
[root@backup ~]# cat /etc/selinux/config# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted[root@backup ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)
[root@backup ~]#
YUM
web
[root@code caozx26]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
源标识 源名称 状态
local1 local yum 4,070
repolist: 4,070
nfs
[caozx26@localhost ~]$ yum repolist
已加载插件:fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
源标识 源名称 状态
!base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072
!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,791
!extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 526
!updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 6,173
repolist: 30,562
[caozx26@localhost ~]$ yum install nfsbind
已加载插件:fastestmirror, langpacks
您需要 root 权限执行此命令。
[caozx26@localhost ~]$ sudo su
[sudo] caozx26 的密码:
对不起,请重试。
[sudo] caozx26 的密码:
[root@nfs caozx26]# yum install http
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
base | 3.6 kB 00:00
epel | 4.3 kB 00:00
extras | 2.9 kB 00:00
updates | 2.9 kB 00:00
没有可用软件包 http。
错误:无须任何处理
web
[root@backup ~]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
源标识 源名称 状态
!lcoal local yum 4,070
repolist: 4,070
ip
web
[root@code caozx26]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d6:84:b3 brd ff:ff:ff:ff:ff:ffinet 192.168.235.10/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed6:84b3/64 scope linkvalid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:d1:59:30 brd ff:ff:ff:ff:ff:ffinet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:d1:59:30 brd ff:ff:ff:ff:ff:ff
nfs
[root@nfs caozx26]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:bb brd ff:ff:ff:ff:ff:ffinet 192.168.235.3/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:c5 brd ff:ff:ff:ff:ff:ffinet 11.1.1.10/24 brd 11.1.1.255 scope global ens34valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed8:7ac5/64 scope linkvalid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
ifdown ens34 为啥无效
[root@nfs caozx26]# ifdown ens34
[root@nfs caozx26]# systemctl restart network
[root@nfs caozx26]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.235.254 0.0.0.0 UG 0 0 0 ens33
11.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 ens34
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 ens33
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 ens34
192.168.235.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
[root@nfs caozx26]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:bb brd ff:ff:ff:ff:ff:ffinet 192.168.235.3/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:c5 brd ff:ff:ff:ff:ff:ffinet 11.1.1.10/24 brd 11.1.1.255 scope global ens34valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed8:7ac5/64 scope linkvalid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
[root@nfs network-scripts]# cat ifcfg-ens34
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=no
DEVICE=ens34
ONBOOT=yes
IPADDR=11.1.1.10
NETMASK=255.255.255.0
GATEWAY=11.1.1.254
DNS1=114.114.114.114
[root@nfs network-scripts]# vim ifcfg-ens34
[root@nfs network-scripts]# cat ifcfg-ens34
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=no
DEVICE=ens34
ONBOOT=no
IPADDR=11.1.1.10
NETMASK=255.255.255.0
GATEWAY=11.1.1.254
DNS1=114.114.114.114
[root@nfs network-scripts]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:bb brd ff:ff:ff:ff:ff:ffinet 192.168.235.3/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:c5 brd ff:ff:ff:ff:ff:ffinet 11.1.1.10/24 brd 11.1.1.255 scope global ens34valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed8:7ac5/64 scope linkvalid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
[root@nfs network-scripts]# systemctl restart network
[root@nfs network-scripts]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.235.254 0.0.0.0 UG 0 0 0 ens33
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 ens33
192.168.235.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
[root@nfs network-scripts]#
成功
backup
[root@backup ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:04:f5:98 brd ff:ff:ff:ff:ff:ffinet 192.168.235.100/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fe04:f598/64 scope linkvalid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:53:dd:1d brd ff:ff:ff:ff:ff:ffinet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:53:dd:1d brd ff:ff:ff:ff:ff:ff
下载nfs
nfs.cn
[root@nfs network-scripts]# yum install nfs-utiles
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
没有可用软件包 nfs-utiles。
错误:无须任何处理
[root@nfs network-scripts]# yum install nfs-utils
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 nfs-utils.x86_64.1.1.3.0-0.68.el7 将被 升级
---> 软件包 nfs-utils.x86_64.1.1.3.0-0.68.el7.2 将被 更新
--> 解决依赖关系完成依赖关系解决===============================================================================Package 架构 版本 源 大小
===============================================================================
正在更新:nfs-utils x86_64 1:1.3.0-0.68.el7.2 updates 413 k事务概要
===============================================================================
升级 1 软件包总计:413 k
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/updates/packages/nfs-utils-1.3.0-0.68.el7.2.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
从 http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:用户ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"指纹 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5来自 : http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在更新 : 1:nfs-utils-1.3.0-0.68.el7.2.x86_64 1/2清理 : 1:nfs-utils-1.3.0-0.68.el7.x86_64 2/2验证中 : 1:nfs-utils-1.3.0-0.68.el7.2.x86_64 1/2验证中 : 1:nfs-utils-1.3.0-0.68.el7.x86_64 2/2更新完毕:nfs-utils.x86_64 1:1.3.0-0.68.el7.2完毕![root@nfs network-scripts]# rpm -q rpcbind
rpcbind-0.2.0-49.el7.x86_64
[root@nfs network-scripts]# rpm -qa|grep ^nfs
nfs-utils-1.3.0-0.68.el7.2.x86_64
nfs4-acl-tools-0.3.3-21.el7.x86_64
nfs.cn
下载rpcbind nfs-utils
[root@nfs network-scripts]# rpm -q rpcbind
rpcbind-0.2.0-49.el7.x86_64
[root@nfs network-scripts]# rpm -qa|grep ^nfs
nfs-utils-1.3.0-0.68.el7.2.x86_64
nfs4-acl-tools-0.3.3-21.el7.x86_64
[root@nfs network-scripts]# yum install rpcbind
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
软件包 rpcbind-0.2.0-49.el7.x86_64 已安装并且是最新版本
无须任何处理
[root@nfs network-scripts]# yum install nfs-utils
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
软件包 1:nfs-utils-1.3.0-0.68.el7.2.x86_64 已安装并且是最新版本
无须任何处理
[root@nfs network-scripts]# rpm -ql rpcbind
/etc/sysconfig/rpcbind
/usr/lib/systemd/system/rpcbind.service
/usr/lib/systemd/system/rpcbind.socket
/usr/lib/tmpfiles.d/rpcbind.conf
/usr/sbin/rpcbind
/usr/sbin/rpcinfo
/usr/share/doc/rpcbind-0.2.0
/usr/share/doc/rpcbind-0.2.0/AUTHORS
/usr/share/doc/rpcbind-0.2.0/ChangeLog
/usr/share/doc/rpcbind-0.2.0/README
/usr/share/man/man8/rpcbind.8.gz
/usr/share/man/man8/rpcinfo.8.gz
/var/lib/rpcbind
[root@nfs network-scripts]# rpm -q rpcbind
rpcbind-0.2.0-49.el7.x86_64
[root@nfs network-scripts]# rpm -qa|gerp *utils
bash: gerp: 未找到命令...
相似命令是: 'grep'
[root@nfs network-scripts]# rpm -qa|grep *utils
[root@nfs network-scripts]# rpm -qa|gerp ^utils
bash: gerp: 未找到命令...
相似命令是: 'grep'
[root@nfs network-scripts]# rpm -qa|gerp ^utils
bash: gerp: 未找到命令...
相似命令是: 'grep'
[root@nfs network-scripts]# rpm -qa|grep ^utils
[root@nfs network-scripts]# rpm -qa|grep ^nfs
nfs-utils-1.3.0-0.68.el7.2.x86_64
nfs4-acl-tools-0.3.3-21.el7.x86_64
rpm -qa|grep ^nfs ^
创建/share
[root@nfs network-scripts]# mkdir /share
[root@nfs network-scripts]# ls
ifcfg-ens33 ifdown-post ifup-eth ifup-sit
ifcfg-ens34 ifdown-ppp ifup-ib ifup-Team
ifcfg-lo ifdown-routes ifup-ippp ifup-TeamPort
ifdown ifdown-sit ifup-ipv6 ifup-tunnel
ifdown-bnep ifdown-Team ifup-isdn ifup-wireless
ifdown-eth ifdown-TeamPort ifup-plip init.ipv6-global
ifdown-ib ifdown-tunnel ifup-plusb network-functions
ifdown-ippp ifup ifup-post network-functions-ipv6
ifdown-ipv6 ifup-aliases ifup-ppp
ifdown-isdn ifup-bnep ifup-routes
[root@nfs network-scripts]# cd /
[root@nfs /]# ls
bin code etc lib media opt root sbin srv tmp var
boot dev home lib64 mnt proc run share sys usr
[root@nfs /]# cd /
[root@nfs /]# ls
bin code etc lib media opt root sbin srv tmp var
boot dev home lib64 mnt proc run share sys usr
配置/etc/exports
[root@nfs /]# vim /etc/exports
[root@nfs /]# cat /etc/exports
/share 192.168.235.0(rw,sync)
修正
[root@nfs /]# vim /etc/exports
[root@nfs /]# cat /etc/exports
/share 192.168.235.0/24(rw,sync)
[root@nfs /]# systemctl restart rpcbind
[root@nfs /]# systemctl restart nfs
[root@nfs /]#
启动NFS
caozx26@192.168.235.3's password:[root@nfs network-scripts]# cd /
[root@nfs /]# ls
bin code etc lib media opt root sbin srv tmp var
boot dev home lib64 mnt proc run share sys usr
[root@nfs /]# cd /
[root@nfs /]# ls
bin code etc lib media opt root sbin srv tmp var
boot dev home lib64 mnt proc run share sys usr
[root@nfs /]# vim /etc/exports
[root@nfs /]# cat /etc/exports
/share 192.168.235.0(rw,sync)
[root@nfs /]# systemctl start rpcbind
[root@nfs /]# systemctl start nfs
[root@nfs /]# ss -naltp |grep 111
LISTEN 0 128 *:111 *:* users:(("rpcbind",pid=721,fd=8))
LISTEN 0 128 [::]:111 [::]:* users:(("rpcbind",pid=721,fd=11))
[root@nfs /]#
web.cn
搭建
[root@code selinux]# yum install httpd -y
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 httpd.x86_64.0.2.4.6-95.el7.centos 将被 安装
--> 正在处理依赖关系 httpd-tools = 2.4.6-95.el7.centos,它被软件包 httpd-2.4.6-95.el7.centos.x86_64 需要
--> 正在处理依赖关系 /etc/mime.types,它被软件包 httpd-2.4.6-95.el7.centos.x86_64 需要
--> 正在检查事务
---> 软件包 httpd-tools.x86_64.0.2.4.6-95.el7.centos 将被 安装
---> 软件包 mailcap.noarch.0.2.1.41-2.el7 将被 安装
--> 解决依赖关系完成依赖关系解决===============================================================================Package 架构 版本 源 大小
===============================================================================
正在安装:httpd x86_64 2.4.6-95.el7.centos local1 2.7 M
为依赖而安装:httpd-tools x86_64 2.4.6-95.el7.centos local1 93 kmailcap noarch 2.1.41-2.el7 local1 31 k事务概要
===============================================================================
安装 1 软件包 (+2 依赖软件包)总下载量:2.8 M
安装大小:9.6 M
Downloading packages:
-------------------------------------------------------------------------------
总计 13 MB/s | 2.8 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装 : mailcap-2.1.41-2.el7.noarch 1/3正在安装 : httpd-tools-2.4.6-95.el7.centos.x86_64 2/3正在安装 : httpd-2.4.6-95.el7.centos.x86_64 3/3验证中 : httpd-tools-2.4.6-95.el7.centos.x86_64 1/3验证中 : mailcap-2.1.41-2.el7.noarch 2/3验证中 : httpd-2.4.6-95.el7.centos.x86_64 3/3已安装:httpd.x86_64 0:2.4.6-95.el7.centos作为依赖被安装:httpd-tools.x86_64 0:2.4.6-95.el7.centos mailcap.noarch 0:2.1.41-2.el7完毕!
[root@code selinux]# systemctl start httpd
[root@code selinux]# echo "NFS666">/var/www/html/index.html
挂载NFS
[root@code html]# mount -t nfs 192.168.235.3:/share/ /var/www/html/media
mount.nfs: access denied by server while mounting 192.168.235.3:/share/
nfs
[root@nfs /]# vim /etc/exports
[root@nfs /]# cat /etc/exports
/share 192.168.235.0/24(rw,sync)
[root@nfs /]# systemctl restart rpcbind
[root@nfs /]# systemctl restart nfs
[root@nfs /]#
web
mount.nfs: access denied by server while mounting 192.168.235.3:/share/
[root@code html]# mount -t nfs 192.168.235.3:/share/ /var/www/html/media
mount.nfs: access denied by server while mounting 192.168.235.3:/share/
[root@code html]# mount -t nfs 192.168.235.3:/share/ /var/www/html/media
[root@code html]# df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 470M 0 470M 0% /dev
tmpfs 487M 0 487M 0% /dev/shm
tmpfs 487M 8.6M 478M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/mapper/centos-root 17G 4.5G 13G 27% /
/dev/sda1 1014M 172M 843M 17% /boot
/dev/sr0 4.4G 4.4G 0 100% /mnt
tmpfs 98M 28K 98M 1% /run/user/1001
192.168.235.3:/share 17G 5.9G 12G 35% /var/www/html/media
测试
码
web
[code@code ~]$ date
2025年 06月 20日 星期五 20:35:38 CST
[code@code ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d6:84:b3 brd ff:ff:ff:ff:ff:ffinet 192.168.235.10/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed6:84b3/64 scope link valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:d1:59:30 brd ff:ff:ff:ff:ff:ffinet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:d1:59:30 brd ff:ff:ff:ff:ff:ff
[code@code ~]$ 12
┌──────────────────────────────────────────────────────────────────────┐│ • MobaXterm Personal Edition v23.2 • ││ (SSH client, X server and network tools) ││ ││ ⮞ SSH session to code@192.168.235.10 ││ • Direct SSH : ✓ ││ • SSH compression : ✓ ││ • SSH-browser : ✓ ││ • X11-forwarding : ✓ (remote display is forwarded through SSH) ││ ││ ⮞ For more info, ctrl+click on help or visit our website. │└──────────────────────────────────────────────────────────────────────┘Last login: Fri Jun 20 20:33:56 2025
[code@code ~]$ su - caozx26
密码:
上一次登录:日 6月 1 22:06:03 CST 2025pts/1 上
[caozx26@code ~]$ sudo su
[sudo] caozx26 的密码:
ABRT 已检测到 '1' 个问题。预了解详细信息请执行:abrt-cli list --since 1748786784
[root@code caozx26]# ip
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }ip [ -force ] -batch filename
where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |vrf }OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |-h[uman-readable] | -iec |-f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |-4 | -6 | -I | -D | -B | -0 |-l[oops] { maximum-addr-flush-attempts } | -br[ief] |-o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |-rc[vbuf] [size] | -n[etns] name | -a[ll] | -c[olor]}
[root@code caozx26]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d6:84:b3 brd ff:ff:ff:ff:ff:ffinet 192.168.235.10/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed6:84b3/64 scope linkvalid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:d1:59:30 brd ff:ff:ff:ff:ff:ffinet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:d1:59:30 brd ff:ff:ff:ff:ff:ff
[root@code caozx26]# hostnamecetl set-hostname web.cn
bash: hostnamecetl: 未找到命令...
[root@code caozx26]# hostnamectl set-hostname web.cn
[root@code caozx26]# hostname
web.cn
[root@code caozx26]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
源标识 源名称 状态
local1 local yum 4,070
repolist: 4,070
[root@code caozx26]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)
[root@code caozx26]# systemctl stop firewalld
[root@code caozx26]# systemctl disable firewalld
[root@code caozx26]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)
[root@code caozx26]# setenforece 0
bash: setenforece: 未找到命令...
[root@code caozx26]# setenforce 0
[root@code caozx26]# cd /etc
[root@code etc]# cd selinux
[root@code selinux]# cat config# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disable
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted[root@code selinux]# vim config
[root@code selinux]# cat config# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted[root@code selinux]# yum install httpd -y
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 httpd.x86_64.0.2.4.6-95.el7.centos 将被 安装
--> 正在处理依赖关系 httpd-tools = 2.4.6-95.el7.centos,它被软件包 httpd-2.4.6-95.el7.centos.x86_64 需要
--> 正在处理依赖关系 /etc/mime.types,它被软件包 httpd-2.4.6-95.el7.centos.x86_64 需要
--> 正在检查事务
---> 软件包 httpd-tools.x86_64.0.2.4.6-95.el7.centos 将被 安装
---> 软件包 mailcap.noarch.0.2.1.41-2.el7 将被 安装
--> 解决依赖关系完成依赖关系解决===============================================================================Package 架构 版本 源 大小
===============================================================================
正在安装:httpd x86_64 2.4.6-95.el7.centos local1 2.7 M
为依赖而安装:httpd-tools x86_64 2.4.6-95.el7.centos local1 93 kmailcap noarch 2.1.41-2.el7 local1 31 k事务概要
===============================================================================
安装 1 软件包 (+2 依赖软件包)总下载量:2.8 M
安装大小:9.6 M
Downloading packages:
-------------------------------------------------------------------------------
总计 13 MB/s | 2.8 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装 : mailcap-2.1.41-2.el7.noarch 1/3正在安装 : httpd-tools-2.4.6-95.el7.centos.x86_64 2/3正在安装 : httpd-2.4.6-95.el7.centos.x86_64 3/3验证中 : httpd-tools-2.4.6-95.el7.centos.x86_64 1/3验证中 : mailcap-2.1.41-2.el7.noarch 2/3验证中 : httpd-2.4.6-95.el7.centos.x86_64 3/3已安装:httpd.x86_64 0:2.4.6-95.el7.centos作为依赖被安装:httpd-tools.x86_64 0:2.4.6-95.el7.centos mailcap.noarch 0:2.1.41-2.el7完毕!
[root@code selinux]# systemctl start httpd
[root@code selinux]# echo "NFS666">/var/www/html/index.html
[root@code selinux]# cd /var/www/html
[root@code html]# ls
index.html
[root@code html]# mount -t nfs 192.168.235.3:/share/ /var/www/html/media
mount.nfs: mount point /var/www/html/media does not exist
[root@code html]# mkdir /var/www/html/meida
[root@code html]# mount -t nfs 192.168.235.3:/share/ /var/www/html/media
mount.nfs: mount point /var/www/html/media does not exist
[root@code html]# df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 470M 0 470M 0% /dev
tmpfs 487M 0 487M 0% /dev/shm
tmpfs 487M 8.6M 478M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/mapper/centos-root 17G 4.5G 13G 27% /
/dev/sda1 1014M 172M 843M 17% /boot
/dev/sr0 4.4G 4.4G 0 100% /mnt
tmpfs 98M 28K 98M 1% /run/user/1001
[root@code html]# mkdir /var/www/html/media
[root@code html]# mount -t nfs 192.168.235.3:/share/ /var/www/html/media
mount.nfs: access denied by server while mounting 192.168.235.3:/share/
[root@code html]# mount -t nfs 192.168.235.3:/share/ /var/www/html/media
mount.nfs: access denied by server while mounting 192.168.235.3:/share/
[root@code html]# mount -t nfs 192.168.235.3:/share/ /var/www/html/media
[root@code html]# df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 470M 0 470M 0% /dev
tmpfs 487M 0 487M 0% /dev/shm
tmpfs 487M 8.6M 478M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/mapper/centos-root 17G 4.5G 13G 27% /
/dev/sda1 1014M 172M 843M 17% /boot
/dev/sr0 4.4G 4.4G 0 100% /mnt
tmpfs 98M 28K 98M 1% /run/user/1001
192.168.235.3:/share 17G 5.9G 12G 35% /var/www/html/media
[root@code html]#
nfs
[root@localhost caozx26]# date
2025年 06月 20日 星期五 20:34:45 CST
[root@localhost caozx26]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:bb brd ff:ff:ff:ff:ff:ffinet 192.168.235.3/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:c5 brd ff:ff:ff:ff:ff:ffinet 11.1.1.10/24 brd 11.1.1.255 scope global ens34valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed8:7ac5/64 scope link valid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
[root@localhost caozx26]#
caozx26@192.168.235.3's password:┌──────────────────────────────────────────────────────────────────────┐│ • MobaXterm Personal Edition v23.2 • ││ (SSH client, X server and network tools) ││ ││ ⮞ SSH session to caozx26@192.168.235.3 ││ • Direct SSH : ✓ ││ • SSH compression : ✓ ││ • SSH-browser : ✓ ││ • X11-forwarding : ✓ (remote display is forwarded through SSH) ││ ││ ⮞ For more info, ctrl+click on help or visit our website. │└──────────────────────────────────────────────────────────────────────┘Last login: Mon May 12 20:15:01 2025 from 192.168.235.1
[caozx26@localhost ~]$ hostname
localhost.localdomain
[caozx26@localhost ~]$ hostnamectl set-hostname nfs.cn
==== AUTHENTICATING FOR org.freedesktop.hostname1.set-static-hostname ===
Authentication is required to set the statically configured local host name, as well as the pretty host name.
Authenticating as: caozx26
Password:
==== AUTHENTICATION COMPLETE ===
[caozx26@localhost ~]$ hostname
hostname
nfs.cn
[caozx26@localhost ~]$ yum repolist
已加载插件:fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
源标识 源名称 状态
!base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072
!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,791
!extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 526
!updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 6,173
repolist: 30,562
[caozx26@localhost ~]$ yum install nfsbind
已加载插件:fastestmirror, langpacks
您需要 root 权限执行此命令。
[caozx26@localhost ~]$ sudo su
[sudo] caozx26 的密码:
对不起,请重试。
[sudo] caozx26 的密码:
[root@nfs caozx26]# yum install http
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
base | 3.6 kB 00:00
epel | 4.3 kB 00:00
extras | 2.9 kB 00:00
updates | 2.9 kB 00:00
没有可用软件包 http。
错误:无须任何处理
[root@nfs caozx26]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)5月 10 05:13:51 localhost.localdomain systemd[1]: Starting firewalld - dyna...
5月 10 05:13:52 localhost.localdomain systemd[1]: Started firewalld - dynam...
5月 10 05:13:53 localhost.localdomain firewalld[828]: WARNING: AllowZoneDri...
5月 10 08:41:22 localhost.localdomain systemd[1]: Stopping firewalld - dyna...
5月 10 08:41:26 localhost.localdomain systemd[1]: Stopped firewalld - dynam...
Hint: Some lines were ellipsized, use -l to show in full.
[root@nfs caozx26]# setenforce 0
[root@nfs caozx26]# cat /etc/selinux/config# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted[root@nfs caozx26]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:bb brd ff:ff:ff:ff:ff:ffinet 192.168.235.3/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:c5 brd ff:ff:ff:ff:ff:ffinet 11.1.1.10/24 brd 11.1.1.255 scope global ens34valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed8:7ac5/64 scope linkvalid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
[root@nfs caozx26]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.235.254 0.0.0.0 UG 0 0 0 ens33
11.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 ens34
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 ens33
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 ens34
192.168.235.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
[root@nfs caozx26]# ping www.baidu.com
PING www.baidu.com (223.109.82.16) 56(84) bytes of data.
^C64 bytes from 223.109.82.16: icmp_seq=1 ttl=128 time=21.4 ms--- www.baidu.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 21.497/21.497/21.497/0.000 ms
[root@nfs caozx26]# ping www.baidu.com
PING www.baidu.com (223.109.82.212) 56(84) bytes of data.
64 bytes from 223.109.82.212 (223.109.82.212): icmp_seq=1 ttl=128 time=16.4 ms
64 bytes from 223.109.82.212 (223.109.82.212): icmp_seq=2 ttl=128 time=14.5 ms
64 bytes from 223.109.82.212 (223.109.82.212): icmp_seq=3 ttl=128 time=16.3 ms
^C
--- www.baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 11033ms
rtt min/avg/max/mdev = 14.512/15.796/16.484/0.914 ms
[root@nfs caozx26]# ifdown ens34
[root@nfs caozx26]# systemctl restart network
[root@nfs caozx26]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.235.254 0.0.0.0 UG 0 0 0 ens33
11.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 ens34
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 ens33
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 ens34
192.168.235.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
[root@nfs caozx26]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:bb brd ff:ff:ff:ff:ff:ffinet 192.168.235.3/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:c5 brd ff:ff:ff:ff:ff:ffinet 11.1.1.10/24 brd 11.1.1.255 scope global ens34valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed8:7ac5/64 scope linkvalid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
[root@nfs caozx26]# cd /etc/sysconfig
[root@nfs sysconfig]# ls
anaconda grub network-scripts run-parts
atd init nfs samba
authconfig ip6tables-config ntpd saslauthd
autofs iptables-config ntpdate selinux
cbq irqbalance qemu-ga smartmontools
cgred kdump radvd sshd
chronyd kernel raid-check svnserve
console ksm rdisc sysstat
cpupower libvirtd readonly-root sysstat.ioconf
crond man-db rpcbind virtlockd
ebtables-config modules rpc-rquotad virtlogd
fcoe netconsole rsyncd wpa_supplicant
firewalld network rsyslog
[root@nfs sysconfig]# cd network-scripts
[root@nfs network-scripts]# ls
ifcfg-ens33 ifdown-post ifup-eth ifup-sit
ifcfg-ens34 ifdown-ppp ifup-ib ifup-Team
ifcfg-lo ifdown-routes ifup-ippp ifup-TeamPort
ifdown ifdown-sit ifup-ipv6 ifup-tunnel
ifdown-bnep ifdown-Team ifup-isdn ifup-wireless
ifdown-eth ifdown-TeamPort ifup-plip init.ipv6-global
ifdown-ib ifdown-tunnel ifup-plusb network-functions
ifdown-ippp ifup ifup-post network-functions-ipv6
ifdown-ipv6 ifup-aliases ifup-ppp
ifdown-isdn ifup-bnep ifup-routes
[root@nfs network-scripts]# cat ifcfg-ens34
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=no
DEVICE=ens34
ONBOOT=yes
IPADDR=11.1.1.10
NETMASK=255.255.255.0
GATEWAY=11.1.1.254
DNS1=114.114.114.114
[root@nfs network-scripts]# vim ifcfg-ens34
[root@nfs network-scripts]# cat ifcfg-ens34
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=no
DEVICE=ens34
ONBOOT=no
IPADDR=11.1.1.10
NETMASK=255.255.255.0
GATEWAY=11.1.1.254
DNS1=114.114.114.114
[root@nfs network-scripts]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:bb brd ff:ff:ff:ff:ff:ffinet 192.168.235.3/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:d8:7a:c5 brd ff:ff:ff:ff:ff:ffinet 11.1.1.10/24 brd 11.1.1.255 scope global ens34valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed8:7ac5/64 scope linkvalid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:62:f3:9e brd ff:ff:ff:ff:ff:ff
[root@nfs network-scripts]# systemctl restart network
[root@nfs network-scripts]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.235.254 0.0.0.0 UG 0 0 0 ens33
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 ens33
192.168.235.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
[root@nfs network-scripts]# hostname
nfs.cn
[root@nfs network-scripts]# yum install rpcbind
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
软件包 rpcbind-0.2.0-49.el7.x86_64 已安装并且是最新版本
无须任何处理
[root@nfs network-scripts]# yum install nfs-utiles
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
没有可用软件包 nfs-utiles。
错误:无须任何处理
[root@nfs network-scripts]# yum install nfs-utils
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 nfs-utils.x86_64.1.1.3.0-0.68.el7 将被 升级
---> 软件包 nfs-utils.x86_64.1.1.3.0-0.68.el7.2 将被 更新
--> 解决依赖关系完成依赖关系解决===============================================================================Package 架构 版本 源 大小
===============================================================================
正在更新:nfs-utils x86_64 1:1.3.0-0.68.el7.2 updates 413 k事务概要
===============================================================================
升级 1 软件包总计:413 k
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/updates/packages/nfs-utils-1.3.0-0.68.el7.2.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
从 http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:用户ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"指纹 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5来自 : http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在更新 : 1:nfs-utils-1.3.0-0.68.el7.2.x86_64 1/2清理 : 1:nfs-utils-1.3.0-0.68.el7.x86_64 2/2验证中 : 1:nfs-utils-1.3.0-0.68.el7.2.x86_64 1/2验证中 : 1:nfs-utils-1.3.0-0.68.el7.x86_64 2/2更新完毕:nfs-utils.x86_64 1:1.3.0-0.68.el7.2完毕!
[root@nfs network-scripts]# rpm -q rpcbind
rpcbind-0.2.0-49.el7.x86_64
[root@nfs network-scripts]# rpm -qa|grep ^nfs
nfs-utils-1.3.0-0.68.el7.2.x86_64
nfs4-acl-tools-0.3.3-21.el7.x86_64
[root@nfs network-scripts]# yum install rpcbind
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
软件包 rpcbind-0.2.0-49.el7.x86_64 已安装并且是最新版本
无须任何处理
[root@nfs network-scripts]# yum install nfs-utils
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
软件包 1:nfs-utils-1.3.0-0.68.el7.2.x86_64 已安装并且是最新版本
无须任何处理
[root@nfs network-scripts]# rpm -ql rpcbind
/etc/sysconfig/rpcbind
/usr/lib/systemd/system/rpcbind.service
/usr/lib/systemd/system/rpcbind.socket
/usr/lib/tmpfiles.d/rpcbind.conf
/usr/sbin/rpcbind
/usr/sbin/rpcinfo
/usr/share/doc/rpcbind-0.2.0
/usr/share/doc/rpcbind-0.2.0/AUTHORS
/usr/share/doc/rpcbind-0.2.0/ChangeLog
/usr/share/doc/rpcbind-0.2.0/README
/usr/share/man/man8/rpcbind.8.gz
/usr/share/man/man8/rpcinfo.8.gz
/var/lib/rpcbind
[root@nfs network-scripts]# rpm -q rpcbind
rpcbind-0.2.0-49.el7.x86_64
[root@nfs network-scripts]# rpm -qa|gerp *utils
bash: gerp: 未找到命令...
相似命令是: 'grep'
[root@nfs network-scripts]# rpm -qa|grep *utils
[root@nfs network-scripts]# rpm -qa|gerp ^utils
bash: gerp: 未找到命令...
相似命令是: 'grep'
[root@nfs network-scripts]# rpm -qa|gerp ^utils
bash: gerp: 未找到命令...
相似命令是: 'grep'
[root@nfs network-scripts]# rpm -qa|grep ^utils
[root@nfs network-scripts]# rpm -qa|grep ^nfs
nfs-utils-1.3.0-0.68.el7.2.x86_64
nfs4-acl-tools-0.3.3-21.el7.x86_64
[root@nfs network-scripts]# mkdir /share
[root@nfs network-scripts]# ls
ifcfg-ens33 ifdown-post ifup-eth ifup-sit
ifcfg-ens34 ifdown-ppp ifup-ib ifup-Team
ifcfg-lo ifdown-routes ifup-ippp ifup-TeamPort
ifdown ifdown-sit ifup-ipv6 ifup-tunnel
ifdown-bnep ifdown-Team ifup-isdn ifup-wireless
ifdown-eth ifdown-TeamPort ifup-plip init.ipv6-global
ifdown-ib ifdown-tunnel ifup-plusb network-functions
ifdown-ippp ifup ifup-post network-functions-ipv6
ifdown-ipv6 ifup-aliases ifup-ppp
ifdown-isdn ifup-bnep ifup-routes
[root@nfs network-scripts]# cd /
[root@nfs /]# ls
bin code etc lib media opt root sbin srv tmp var
boot dev home lib64 mnt proc run share sys usr
[root@nfs /]# cd /
[root@nfs /]# ls
bin code etc lib media opt root sbin srv tmp var
boot dev home lib64 mnt proc run share sys usr
[root@nfs /]# vim /etc/exports
[root@nfs /]# cat /etc/exports
/share 192.168.235.0(rw,sync)
[root@nfs /]# systemctl start rpcbind
[root@nfs /]# systemctl start nfs
[root@nfs /]# ss -naltp |grep 111
LISTEN 0 128 *:111 *:* users:(("rpcbind",pid=721,fd=8))
LISTEN 0 128 [::]:111 [::]:* users:(("rpcbind",pid=721,fd=11))
[root@nfs /]# ls
bin code etc lib media opt root sbin srv tmp var
boot dev home lib64 mnt proc run share sys usr
[root@nfs /]# vim /etc/exports
[root@nfs /]# cat /etc/exports
/share 192.168.235.0/24(rw,sync)
[root@nfs /]# systemctl restart rpcbind
[root@nfs /]# systemctl restart nfs
[root@nfs /]#
backup
[backup@backup ~]$ date
2025年 06月 21日 星期六 04:39:07 CST
[backup@backup ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:04:f5:98 brd ff:ff:ff:ff:ff:ffinet 192.168.235.100/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fe04:f598/64 scope link valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:53:dd:1d brd ff:ff:ff:ff:ff:ffinet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:53:dd:1d brd ff:ff:ff:ff:ff:ff
[backup@backup ~]$ cd /etc/ssh
[backup@backup ssh]$ cat ssh-config
cat: ssh-config: 没有那个文件或目录
[backup@backup ssh]$ cat config
cat: config: 没有那个文件或目录
[backup@backup ssh]$ cat sshd_config
cat: sshd_config: 权限不够
[backup@backup ssh]$ sudo su
[sudo] backup 的密码:
backup 不在 sudoers 文件中。此事将被报告。
[backup@backup ssh]$ su - caozx26
密码:
上一次登录:日 6月 1 22:06:09 CST 2025pts/1 上
[caozx26@backup ~]$ sudo su
[sudo] caozx26 的密码:
ABRT 已检测到 '1' 个问题。预了解详细信息请执行:abrt-cli list --since 1748786775
[root@backup caozx26]# ls
公共 模板 视频 图片 文档 下载 音乐 桌面
[root@backup caozx26]# cd /etc/ssh
[root@backup ssh]# ls
moduli ssh_host_ecdsa_key ssh_host_ed25519_key.pub
ssh_config ssh_host_ecdsa_key.pub ssh_host_rsa_key
sshd_config ssh_host_ed25519_key ssh_host_rsa_key.pub
[root@backup ssh]# cat ssh_config
# $OpenBSD: ssh_config,v 1.30 2016/02/20 23:06:23 sobrado Exp $# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.# Site-wide defaults for some commonly used options. For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.# Host *
# ForwardAgent no
# ForwardX11 no
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# IdentityFile ~/.ssh/id_ecdsa
# IdentityFile ~/.ssh/id_ed25519
# Port 22
# Protocol 2
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
# RekeyLimit 1G 1h
#
# Uncomment this if you want to use .local domain
# Host *.local
# CheckHostIP noHost *GSSAPIAuthentication yes
# If this option is set to yes then remote X11 clients will have full access
# to the original X11 display. As virtually no X11 client supports the untrusted
# mode correctly we set this to yes.ForwardX11Trusted yes
# Send locale-related environment variablesSendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGESSendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENTSendEnv LC_IDENTIFICATION LC_ALL LANGUAGESendEnv XMODIFIERS
[root@backup ssh]# ls
moduli ssh_config sshd_config ssh_host_ecdsa_key ssh_host_ecdsa_key.pub ssh_host_ed25519_key ssh_host_ed25519_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub
[root@backup ssh]# cat sshd_config
# $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.# This sshd was compiled with PATH=/usr/local/bin:/usr/bin# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key# Ciphers and keying
#RekeyLimit default none# Logging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO# Authentication:#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10#PubkeyAuthentication yes# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys#AuthorizedPrincipalsFile none#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
#KerberosUseKuserok yes# GSSAPI options
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
#GSSAPIEnablek5users no# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
# WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several
# problems.
UsePAM yes#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation sandbox
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none# no default banner path
#Banner none# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
[root@backup ssh]#
root@192.168.235.100's password:┌──────────────────────────────────────────────────────────────────────┐│ • MobaXterm Personal Edition v23.2 • ││ (SSH client, X server and network tools) ││ ││ ⮞ SSH session to root@192.168.235.100 ││ • Direct SSH : ✓ ││ • SSH compression : ✓ ││ • SSH-browser : ✓ ││ • X11-forwarding : ✓ (remote display is forwarded through SSH) ││ ││ ⮞ For more info, ctrl+click on help or visit our website. │└──────────────────────────────────────────────────────────────────────┘Last login: Sat Jun 21 04:40:06 2025
/usr/bin/xauth: file /root/.Xauthority does not exist
[root@backup ~]# hostname
backup.itcast.cn
[root@backup ~]# hostnamectl set-hostname nfs.cn
[root@backup ~]# hostname
nfs.cn
[root@backup ~]# hostnamectl set-hostname backup.cn
[root@backup ~]# hostname
backup.cn
[root@backup ~]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
源标识 源名称 状态
!lcoal local yum 4,070
repolist: 4,070
[root@backup ~]# cat /etc/selinux/config# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disable
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted[root@backup ~]# vim /etc/selinux/config
[root@backup ~]# cat /etc/selinux/config# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted[root@backup ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)
[root@backup ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000link/ether 00:0c:29:04:f5:98 brd ff:ff:ff:ff:ff:ffinet 192.168.235.100/24 brd 192.168.235.255 scope global ens33valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fe04:f598/64 scope linkvalid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000link/ether 52:54:00:53:dd:1d brd ff:ff:ff:ff:ff:ffinet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000link/ether 52:54:00:53:dd:1d brd ff:ff:ff:ff:ff:ff
[root@backup ~]#