CentOS6.5x64使用Samba架设公共盘-匿名访问

来源:互联网 发布:战略规划 知乎 编辑:程序博客网 时间:2024/06/15 00:42
1、首先关闭selinux
#vi /etc/selinux/configSELINUX=disabled

暂时关闭防火墙:
#service iptables stop

永久关闭防火墙
#chkconfig iptables off

重启系统
#reboot

2、安装及配置samba

2.1、安装samba
#yum install samba samba-client samba-swat

1.2、配置samba
主配置文件在 /etc/samba/smb.conf
#vi /etc/samba/smb.conf编辑如下内容:workgroup = WORKGROUP                              (工作组)netbios name = SambaSERVER                          (NetBios名称)interfaces = lo eth0 100.10.0.179/24(监听的网卡/IP地址)hosts allow = 127.0.0.1 100.10.0.(允许访问的IP/IP段)log file = /data/log/samba/log.%m(日志存放位置)security = share                                         (验证模式为共享-匿名)load printers = no(是否在启动Samba时就共享打印机)printing = bsd(修改打印系统,默认为cups)printcap name=/dev/null(设置打印机的配置文路径)disable spoolss=yes(隐藏打印机)在最后增加[public]       comment = Public Stuff       path = /data/share/public       public = yes       writable = yes       printable = no       write list = +staff
保存退出

创建共享目录/data/share/public并设置为nobody权限
#mkdir /data/share
#mkdir /data/share/public
#chown -R nobody:nobody /data/share/public
#mkdir /data/log
#mkdir /data/log/samba

启动samba
#/etc/init.d/smb start

重新加载配置:
#service smb reload

重启
#/etc/init.d/smb restart

查看启动状态
#service smb status

设置开机启动
#chkconfig --level 35 smb on

测试smb.conf配置是否正确
#testparm

Linux下连接
#smbclient //100.10.0.179/public
WARNING: The security=share option is deprecated
Enter root's password: 
(直接回车即进入smb)
smb:\>

win7下连接

访问:\\100.10.0.179\public


大笑有图有真相:

图1:Linux下访问



图2:Win7下访问




0 0
原创粉丝点击