配置(服务端)
1)samba
#mkdir /common //创建被共享的文档
#useradd harry ; pdbedit -a harry //创建系统和samba用户
#vim /etc/samba/smb.conf
workgroup = STAFF //声明工作组
......
[common]
path = /common //声明被共享目录
hosts allow = 172.25.0.0/24 //声明可访问网段
#systemctl restart smb
#systemctl enable smb
//起服务
1)samba (挂载)
#yum -y install samba-client cifs-utils
//安装samba客户端和cifs格式包
#smbclient -L 172.25.0.11 //查看资源
#mkdir /mnt/dev
#vim /etc/fstab
//172.25.0.11/public /mnt/dev cifs _netdev 0 0
#mount -a
2)NFS
#mkdir -p /public //创建被共享目录
#vim /etc/exports
/public 172.25.X.0/24(ro) //声明被共享目录和设置,可访问网段及权限
#systemctl restart nfs-secure-server nfs-server
#systemctl enable nfs-secure-server nfs-server
//起服务
2)NFS(挂载)
# mkdir -p /mnt/nfsmount //创建挂载点
#showmount -e server0
Export list for serverX:
/public 172.25.0.0/24 //查看挂载资源
# vim /etc/fstab
.. ..
Server0.example.com:/public /mnt/nfsmount nfs _netdev 0 0
#mount -a //挂载
网友评论