1.方式
采用samba服务,windows挂载linux系统的文件夹
2.安装samba服务
[root@lvrnlw-67-145 ~]# yum install samba
修改配置文件/etc/samba/smb.conf
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[php]
path = /root/wtyproject
writable = yes
create mask = 777
directory mask = 777
[hyperf]
path = /www/wwwroot
writable = yes
create mask = 777
directory mask = 777
保留[global],删除[homes]、[printers]、[print$],添加[php]和[hyperf]
3.设置相关权限
1.关闭防火墙:systemctl stop firewalld
2.被挂载的目录和文件设置权限
4.创建共享资源的账户
[root@lvrnlw-67-145 ~]# useradd root
[root@lvrnlw-67-145 ~]# pdbedit -a -u root
设置好对应密码
5.创建共享目录
[root@lvrnlw-67-145 ~]# chown root: /www/wwwroot
6.启动
[root@lvrnlw-67-145 ~]# systemctl start smb
7.检验是否挂载成功
8.相关命令
systemctl status smb.service #检查是否运行
systemctl start smb #开启服务
systemctl enable smb.service #设置开机自启动
systemctl enable nmb #设置开机自启动