温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

centos7 搭建 samba,win10访问centos7共享的文件路径

发布时间:2020-08-27 21:25:57 来源:网络 阅读:12912 作者:313119992 栏目:建站服务器

centos7 搭建 samba,win10访问centos7共享的文件路径

  1. 首先安装samba相关的服务
    yum install -y samba*
  2. 配置samba的配置文件
    cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
    vim /etc/samba/smb.conf
    //修改配置文件smb.conf的内容为下述内容
    [global]
    log file = /var/log/samba/log.%m
    max log size = 50
    security = user
    map to guest = Bad User
    [sambadir]
    path=/home/
    readonly=yes
    browseable=yes
    writable = yes 
    guest ok=yes
  3. 配置系统文件打开数目上限(因为后续会通过samba文件打开大量文件,所以需要修改此参数)
    vim /etc/security/limits.conf
    //文件末尾需要添加如下内容
    * soft nofile 65535
    * hard nofile 65535
    //修改该文件后,需要reboot,这里暂不reboot,后面关闭防火墙后也需要reboot
  4. 关闭防火墙
    vim /etc/selinux/config                      #永久关闭selinux
    set SELINUX=disabled       #SELINUX=enforcing改为SELINUX=disabled
    //关闭firewall
    systemctl stop firewalld
    systemctl disable firewalld
    //这里需要reboot才能生效
  5. reboot
  6. 启动SAMBA
    systemctl restart smb #重启
    systemctl enable smb #修改为开机启动
    systemctl status smb #查看状态
  7. 在window文件浏览器里输入\your samba server ip
  8. win10 下开启网络发现。
    https://jingyan.baidu.com/article/c275f6ba3ef050e33d756702.html
  9. win10下可能无法访问共享文件夹解决
    //管理员权限进入cmd
    //开启SMBv1
    sc.exe config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi 
    sc.exe config mrxsmb10 start= auto
    //关闭SMBv2 and SMBv3
    sc.exe config lanmanworkstation depend= bowser/mrxsmb10/nsi 
    sc.exe config mrxsmb20 start= disabled
    (需要重启win10)
  10. 完毕
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI