Samba
- 主配置文件:/etc/samba/smb.conf
- 配置文件中需要添加的参数
- [共享名称]
- comment = asdfsdfg
- path = /home/database
- public = no
- writable = yes
- 添加验证以及设置密码
- pdbedit -a -u user --这输入的密码仅仅是Samba 使用的密码,和服务器密码无关
- systemctl restart smb
- systemctl enable smb
Linux 下挂载Samba 的共享文件,在/etc/fstab 中增加内容
- //IP/共享名称 /挂载路径 cifs credentials=认证文件 0 0
NFS
- 主配置文件:/etc/exports
- 配置文件中内容示例:/nfsfile 192.168.10.10(rw,sync,root_squash)
- systemctl restart rpcbind
- systemctl enable rpcbind
- systemctl start nfs-server
- systemctl enable nfs-server
Linux 下挂载NFS 的共享文件,在/etc/fstab 中增加内容
- IP:路径 /挂载路径 nfs defaults 0 0