一、服务器配置

  1. 安装:yum install -y samba

  2. 更改要共享的path权限:chmod 777 /mnt/samba/

  3. 先备份smb.conf配置文件:cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

  4. 更改配置:vim /etc/samba/smb.conf

             security = share

             load printers = no

             将[home]和[printer]部分注释掉

    更改尾部的[public]如下

            [samba]

            comment= Public Stuff

            path= /mnt/samba

            public = yes

            writable = yes  

  5. 验证设置:testparm

  6. 关闭防火墙:service iptables stop

  7. 启动samba服务器:/etc/init.d/smb start

                    chkconfig smb on

  8. SElinux部分设置:chcon -t samba_share_t /mnt/samba

 

二、Windows客户端访问

\\192.168.1.100,出现samba文件夹,可写入删除,映射为网络磁盘,OK

 

三、linux客户端访问及挂载

  1. yum install -y samba-client

  2. 查看共享的目录:smbclient -L 192.168.1.100

  3. 挂载使用:mount -t cifs //192.168.1.100/samba /mnt/share -o username=root

相关文章:

  • 2021-07-23
  • 2021-04-14
  • 2021-12-12
  • 2021-07-20
  • 2022-02-08
  • 2021-10-31
  • 2022-01-08
  • 2021-09-18
猜你喜欢
  • 2021-12-05
  • 2021-05-17
  • 2021-08-28
  • 2021-09-03
  • 2022-02-08
  • 2021-12-18
相关资源
相似解决方案