samba
yum -y install samba samba-client
rpm -qa |grep samba
service smb start(445端口)
service nmb start(139端口)
配置文件/etc/samba/smb.conf
共享test文件例子如下
[test]
comment = test
path = /test
browseable = YES
hosts allow = 172.168.100.0/24
valid users = czk,anyone
writable = no
write list = czk
mkdir /test
chmod 757 /test ---可写需757
samba用户创建
useradd czk
smbpasswd -a czk
挂载用法
方法一:smbclient //SAMBAIP/PATH -U USER%PASSWD
方法二:mount -o username=USER,password=PASSWD -t cifs //IP/PATH 挂在点
NFS
yum install nfs-utils -y
service nfs start
chkconfig nfs on
配置文件 /etc/exports
共享例子(共享nfs_test目录)
chmod 757 /nfs_test
--------------------------------
vim /etc/exports
/nfs_test 172.168.100.0/24(rw,sync)
--------------------------------
# 查看命令
showmount -e 172.168.100.100
exportfs -r
exportfs -v
创建挂载点
mkdir /opt/nfs
mount -t nfs IP:/nfs_test /opt/nfs/