NFS(分布式文件系统)服务器安装windows
1.服务端安装
[root@localhost ~]# yum install nfs-utils 安装nfs
[root@localhost ~]# systemctl start rpcbind 服务端配置
[root@localhost ~]# systemctl start nfs
[root@localhost ~]# mkdir data 配置共享目录
[root@localhost ~]# chmod 755 /data
[root@localhost ~]# vi /etc/exports 设置配置文件
/data/ 192.168.216.130(rw,sync,no_root_squash,no_all_squash)nfs 服务安装完毕
/data: 共享目录位置。192.168.216.130/24: 客户端 IP 范围,本文是限制某个子网,若是是* 表明没有限制。rw: 权限设置,可读可写。sync: 同步共享目录。no_root_squash: 可使用 root 受权。no_all_squash: 可使用普通用户受权。
showmount -e localhost确认是否安装完成
2.客户端安装
[root@localhost ~]# yum install nfs-utils 安装nfs
showmount -e 192.168.216.128
mkdir /mnt/data
mount -t nfs 192.168.216.128:/data /mnt/data
SAMBA(网络文件共享)服务器安装
1.把网络改成桥接模式:复制物理网络链接状态
yum -y install samba 安装samba
systemctl stop firewalld.service 关闭防火墙
setatus
service smb status
useradd sambauser 建立用户
smbpasswd -a sambauser 设置密码
在windows运行窗口输入Linux虚拟机的IP地址就能够查询共享的网络文件了