Samba配置过程

服务端基本配置

#yum -y install samba samba-client
#vim /etc/samba/smb.conf

[webdev]
path = /smb/webdev
public = yes
vaild user = root
writeable = yes
printable = no
create mask = 0644
directory mask = 0755

#mkdir -p /smb/webdev
#touch /smb/webdev/{1..100}.txt
#smbpasswd -a root
#systemctl start smb nmb
#systemctl enable smb nmb

客户端基本配置

#yum -y install cifs-utils
#mkdir /mnt/test-samba
#mount //IPADDRESS/webdev /mnt/test-samba
#vim /etc/fstab
//IPADDRESS/webdev /mnt/test-samba cifs defaults,user=root,password=centos 0 0

NFS配置过程

服务端配置

#yum -y install nfs-utils rpcbind
#systemctl start rpcbind
#systemctl start nfs
#systemctl enable rpcbind nfs
#vim /etc/exports
/mnt/nfstest (rw,sync,norootsquash)
#systemctl restart rpcbind
#systemctl restart nfs[liuchao@master ~]$ sudo firewall-cmd --permanent --add-service=nfs
#firewall-cmd --reload
#touch /mnt/nfstest/{1..100}.gif

客户端配置

#yum -y install nfs-utils rpcbind
#systemctl start rpcbind
#systemctl start nfs
#systemctl enable rpcbind nfs
#vim /etc/fstab
IPADDRESS:/nfstest /mnt/nfs-test cifs defaults 0 0 [liuchao@slave ~]$ sudo mount -a
#df -Th***