LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1468|回复: 7

samba共享不了,请帮忙

[复制链接]
发表于 2008-3-1 22:47:11 | 显示全部楼层 |阅读模式
大家好。
我用的是:
uname -a:

Linux gentoo 2.6.23-gentoo-r8 #1 SMP Sat Feb 16 19:57:49 CST 2008 i686 Intel(R) Pentium(R) D CPU 2.66GHz GenuineIntel GNU/Linux

etc/samba/smb.conf如下:

[global]
#       workgroup = Genbox  #这是你的工作组名
        netbios name = gentoo  #你的主机名
        server string = Gentoo Share Server  #主机描述性文字
        security = user #设置为共享级别...安全? 我管不着,我拿来传东西的

[Share]  #设置你的共享文件夹在局域网中所显示的名称
        path = /data/Share  #这是你要共享的文件夹
       # guest ok = yes  #设置为可匿名登陆
        writable = yes
        valid users = sharer
       # browseable = no #设置为可浏览的文件夹模式
        username map = /etc/samba/smbusers
        available = yes
        public = no

/etc/samba/smbusers:
# Unix_name = SMB_name1 SMB_name2 ...
# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/files/config/smbusers,v 1.1 2007/09/07 21:07:40 dev-zero Exp $
#root = administrator admin
#nobody = guest pcguest smbguest
sharer = sharer

文件夹的权限为:
drwxrwxrwx 2 sharer share         80 2008-01-25 20:09 Share

testparm:

Load smb config files from /etc/samba/smb.conf
Processing section "[Share]"
Global parameter username map found in service section!
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        netbios name = GENTOO  #你的主机名
        server string = Gentoo Share Server  #主机描述性文字

[Share]
        path = /data/Share  #这是你要共享的文件夹
        valid users = sharer,
        read only = No


用smbpasswd -a 将sharer添加了samba用户。

在另外一个机器上访问这个文件夹的话,弹出如下对话框:
无法访问,可能没有权限使用网络资源,请与管理员联系以查明是否有访问权限。无任何网络提供程序接受指定的网络路径。
发表于 2008-3-3 13:29:19 | 显示全部楼层
为啥看不到hosts allow的设置呢?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-3 20:14:32 | 显示全部楼层
hosts allow?在哪里可以看到呢?
回复 支持 反对

使用道具 举报

发表于 2008-3-3 20:25:20 | 显示全部楼层
看看日志。。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-3 20:38:22 | 显示全部楼层
我看了
/var/log/samba/log.nmbd
quote:
[2008/03/03 19:29:34, 0] nmbd/nmbd.c:main(697)
  Netbios nameserver version 3.0.28 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2007
[2008/03/03 19:35:19, 0] nmbd/nmbd_become_lmb.c:become_local_master_stage2(396)
  *****
  
  Samba name server GENTOO  #你的主机名 is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.102

/var/log/samba/log.nmbd
quote:
[2008/03/03 19:29:33, 0] smbd/server.c:main(944)
  smbd version 3.0.28 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2007
[2008/03/03 19:29:34, 0] param/loadparm.c:lp_do_parameter(3521)
  Global parameter username map found in service section!
[2008/03/03 19:29:34, 0] printing/pcap.c:pcap_cache_reload(159)
  Unable to open printcap file /etc/printcap for read!
[2008/03/03 19:29:34, 0] printing/pcap.c:pcap_cache_reload(159)
  Unable to open printcap file /etc/printcap for read!
[2008/03/03 19:46:11, 0] printing/pcap.c:pcap_cache_reload(159)
  Unable to open printcap file /etc/printcap for read!
[2008/03/03 19:46:11, 0] printing/pcap.c:pcap_cache_reload(159)
  Unable to open printcap file /etc/printcap for read!
[2008/03/03 20:02:22, 0] printing/pcap.c:pcap_cache_reload(159)
  Unable to open printcap file /etc/printcap for read!
[2008/03/03 20:02:22, 0] printing/pcap.c:pcap_cache_reload(159)
  Unable to open printcap file /etc/printcap for read!
回复 支持 反对

使用道具 举报

发表于 2008-3-4 12:54:05 | 显示全部楼层
Post by chewe;1822690
hosts allow?在哪里可以看到呢?

在/etc/samba/smb.conf里设置。
这个参数控制哪些机器能访问你的samba server。
一般写成
hosts allow = 192.168.0. //针对某个网段
hosts allow =192.168.0.101 192.168.0.103 //针对具体ip
回复 支持 反对

使用道具 举报

发表于 2008-3-4 22:46:10 | 显示全部楼层
设置security = share, 访问不是很简单.
如果在windows下访问,登录的用户名必须为sharer, 否则你的设置,应该是无法登录的.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-5 22:07:12 | 显示全部楼层
我把hosts allow也加上去了,双击文件夹的时候弹出用户名、密码输入框,输入正确的用户名(sharer)、密码还是提示没有权限。

Blahster:
那我security应该设置为什么?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表