免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1849 | 回复: 2
打印 上一主题 下一主题

[samba] 最简单的samba服务搭建 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2016-09-11 21:57 |只看该作者 |倒序浏览
1、首先关闭SElinux和iptables
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
[root@localhost ~]# reboot
[root@localhost ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                                    [  OK  ]
iptables: Unloading modules:                                      [  OK  ]
[root@localhost ~]# getenforce
Disabled
2、使用yum进行samba安装
[root@localhost ~]# yum install samba -y
[root@localhost ~]# rpm -q samba
samba-3.6.23-36.el6_8.x86_64
3、编辑配置文件
[root@localhost test]# vim /etc/samba/smb.conf
[global]
hosts allow = 127. 192.168.12. 192.168.13. 192.168.192.
允许哪些计算机可以访问Samba服务器,可以输入多个IP地址,也可以设置成某个网段
security = share   (设置Samba服务器的基本安全级)
#==================== Share Definitions =====================
[test]
        path = /test (设置共享目录对应linux文件系统的/test目录)
        public = yes ( 设置共享目录是否允许匿名访问 )
        read only = no  (设置共享目录是否为只读模式。)
4、对需要共享的文件设置权限
[root@localhost ~]# chmod 777 /test
[root@localhost ~]# useradd -g test test
[root@localhost ~]# chown test:test /test
[root@localhost ~]# smbpasswd -a test
New SMB password:
Retype new SMB password:
Added user test.
5、重启samba服务
[root@localhost ~]# service smb restart
Shutting down SMB services:                                [  OK  ]
Starting SMB services:                                           [  OK  ]
6、然后再windows直接访问\\IP\test即可进入linux目录进行文件访问

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
2 [报告]
发表于 2016-09-21 11:45 |只看该作者
确实简单,楼主实用主义哈哈。不过这玩意深入进去要花不少时间。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP