samba-4.2.4源码安装及配置

   经常会有这样的需求,应用和数据库服务器都发布在linux上,开发人员经常会去相关日志做诊断,如果linux上能共享文件夹给window就好了,此时samba就派上了用场。

   在samba的官方网站https://www.samba.org/下载最新的源代码。

1. 安装samba
[root@VM-10 samba-4.2.4]#cd /data/gg/samba-4.2.4
[root@localhost samba]# ./configure
[root@localhost samba]# make
[root@localhost samba]# make install

2.配置并检查/etc/samba/smb.conf
改三个地方:
修改security = user
加上map to guest = Bad User (samba 4以上是配置这两个产生,配置security = share无效)
加上[share]
        comment = share all
        path = /data/gg
        guest ok = Yes
        
检查配置文件
[root@VM-10 samba]# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[share]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
        server string = Samba Server Version %v
        map to guest = Bad User
        log file = /var/log/samba/log.%m
        max log size = 50
        idmap config * : backend = tdb
        cups options = raw
[homes]
        comment = Home Directories
        read only = No
        browseable = No
[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        print ok = Yes
        browseable = No
[share]
        comment = share all
        path = /data/gg
        guest ok = Yes
        
3.将/etc/samba/smb.conf 拷贝/usr/local/samba/etc/smb.conf,程序默认读后者    

4.启动服务  
     
[root@VM-10 sbin]# /usr/local/samba/sbin/smbd -D 
[root@VM-10 sbin]# /usr/local/samba/sbin/nmbd -D 

5. 在windows运行中运行\\10.10.15.208即可看到linux下的共享


遇到的错误:
[root@localhost samba]# testparm 
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) 
[root@VM-10 ~]# more /etc/security/limits.conf
root         -     nofile   16384
[root@VM-10 ~]# reboot     

程序无法启动,看系统日志tail -f /var/log/messages   

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值