一、NFS(网络文件系统,实现linux系统上文件共享)
服务器配置
yum install nfs-utils (安装NFS软件包)
iptables -F (清空防火墙)
service iptables save (保存防火墙配置)
mkdir /nfsfile (创建共享文件夹)
chmod -Rf 777 /nfsfile/ (添加共享文件777权限)
echo "hello nfs-server "> /nfsfile/1.txt (添加文件)
vim /etc/exports (编辑nfs配置文件)
systemctl restart rpcbind (NFS服务进行共享之前,需要使用RPC服务将NFS服务器的IP地址和端口号等信息发送给客户端)
systemctl enable rpcbind
systemctl restart nfs-server
systemctl enable nfs-server
iptalbes -F (清空防火墙)
service iptables save
客户端配置
showmount -e 192.168.100.10 (查看NFS服务器共享信息)
mkdir /nfsfile (创建共享文件夹)
chmod -Rf 777 /nfsfile/ (添加共享文件777权限)
vim /etc/fstab
mount -a
二、autofs (自动挂在服务)
yum install autufs
systemctl restart autufs
systemctl enable autufs
vim /etc/auto.master
vim /etc/iso.misc
systemctl restart autofs (重启服务)
三、DNS主服务器配置 (配置DNS主服务器、从服务器、缓存服务器)
yum install bind-chroot
systemctl restart named
systemctl enable named
vim /etc/named.conf (配置著配置文件第11行,any指所有网卡提供DNS 第17行any指所有用户请求查询)
配置DNS区域文件
vim /etc/named.rfc1912.zones
配置DNS数据文件
配置网卡信息
systemctl restart network
cd /var/named (切换到数据配置文件)
cp -a named.localhost dream.com.zone
cp -a named.loopback 192.168.100.arpa
vim dream.com.zone (配置正解析文件)
vim 192.168.100.arpa (配置反向解析)
systenctl restart named
systemctl enable named
nslookup (查看DNS配置)
DNS从服务器配置
yum install bind-chroot
systemctl restart named
systemctl enable named
修改主服务器
vim /etc/named.rfc1912.zones (允许从服务器同步)
iptables -F
service iptables save
修改从服务器
配置网卡信息
vim /etc/named.conf (配置同上)
vim /etc/named.rfc1912.zones
cd /var/named/slaves/
Ls
systemctl restart named (重启服务,同步)
验证
将从服务器dns指向本机并重启网卡服务
nmtui
systenctl restart network
nslookup
DNS 加密(TSIG,加密一串字符串)
主服务器DNS加密
cd /var/named/chroot/etc
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST master-slave
[root@localhost chroot]# cat Kmaster-slave.+157+50591.key
master-slave. IN KEY 512 3 157 rLxN2+BmyRhpUGa8mIOzWg==
vim transfer.key
chown root:named transfer.key
chmod 640 transfer.key
ln transfer.key /etc
vim /etc/named.conf (添加红色标记内容)
systemctl restart named
从服务器DNS加密
cd /var/named/chroot/etc
vim transfer.key
chown root:named transfer.key
chmod 640 transfer.key
ln transfer.key /etc
vim /etc/named.conf (添加红色标记内容)
cd /var/named/slaves/
rm -f *
systemctl restart named