大家好

大家好。
我用的是:
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用户。

在另外一个机器上访问这个文件夹的话,*出如下对话框:
无法访问,可能没有权限使用网络资源,请与管理员联系以查明是否有访问权限。无任何网络提供程序接受指定的网络路径。

 

/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!

 

 

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

 

设置security = share, 访问不是很简单.
如果在windows下访问,登录的用户名必须为sharer, 否则你的设置,应该是无法登录的.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值