smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
-
- 帖子: 39
- 注册时间: 2010-10-18 12:58
smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
passdb backend 设置为 smbpasswd 时,无法访问samba服务器,设置为 tdbsam 则可以访问,遇到这个问题,纠结了好久,没有查找到原因,我的smb.conf内容如下:
#======================= Global Settings ============================
[global]
workgroup = workgroup
security = user
;server string = samba
;netbios name = samba
;encrypt passwords = yes
;passdb backend =tdbsam
passdb backend = smbpasswd
smb passwd file = /etc/samba/smbpasswd
;username map = /etc/samba/smbusers
#===================== Share Definitions ============================
[homes]
comment = Home Directories
path = /home
browseable = yes
writable = yes
valid users = %S
available = yes
[public]
comment = Public Stuff
path = /home/public
browseable = yes
read only = yes
guest ok = yes
available = yes
[Tom]
comment = Tom*s Stuff
path = /home/Tom/
writeable = yes
browseable = yes
available = yes
valid users = Tom
#======================= Global Settings ============================
[global]
workgroup = workgroup
security = user
;server string = samba
;netbios name = samba
;encrypt passwords = yes
;passdb backend =tdbsam
passdb backend = smbpasswd
smb passwd file = /etc/samba/smbpasswd
;username map = /etc/samba/smbusers
#===================== Share Definitions ============================
[homes]
comment = Home Directories
path = /home
browseable = yes
writable = yes
valid users = %S
available = yes
[public]
comment = Public Stuff
path = /home/public
browseable = yes
read only = yes
guest ok = yes
available = yes
[Tom]
comment = Tom*s Stuff
path = /home/Tom/
writeable = yes
browseable = yes
available = yes
valid users = Tom
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
https://help.ubuntu.com/community/Samba ... erverGuide
使用 smbpasswd 關鍵字 搜尋 上面這一篇網頁
使用 smbpasswd 關鍵字 搜尋 上面這一篇網頁
-
- 帖子: 39
- 注册时间: 2010-10-18 12:58
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
谢谢回复,在您给的那个页面,我用 smbpasswd 作为关键字进行搜索,没有结果呢?搜索了好多次都是操作超时。
- astolia
- 论坛版主
- 帖子: 6703
- 注册时间: 2008-09-18 13:11
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
他是叫你Ctrl+F搜索页面上出现的smbpasswd文字,不是在那个search框里搜
-
- 帖子: 39
- 注册时间: 2010-10-18 12:58
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
谢谢,我按照上面描述的做了,还是出现问题“无法访问服务器”,不是防火墙和那个seLinux的问题,因为之前没有关闭防火墙和Selinux也偶尔能够访问过,非常就纠结查了好多资料,感觉我的配置文件没有问题,我的系统是Ubuntu14.04.1 server版本,我的smb.conf文件内容如下:
#======================= Global Settings ============================
[global]
workgroup = workgroup
security = user
server string = Samba
netbios name = Samba
socket options = TCP_NODELAY
max xmit = 65536
use sendfile = yes
os level = 1
passdb backend = smbpasswd
smb passwd file = /etc/samba/smbpasswd
username map = /etc/samba/smbusers
encrypt passwords = true
log level = 10
log file = /var/log/samba/%m.log
max log size = 200
deadtime = 30
keepalive = 60
store dos attributes = no
read raw = yes
write raw = yes
aio read size = 16384
aio write size = 16384
write cache size = 262144
getwd cache = yes
strict locking = no
create mask = 0644
directory mask = 0755
map to guest = bad user
#===================== Share Definitions ============================
[homes]
comment = Home Directories
path = /home
browseable = no
writable = yes
valid users = %S
[Public]
comment = 公共资料目录
path = /data/public
browseable = yes
writable = yes
write list = Tom
read list = Jack,John
available = yes
[Projects]
comment = 项目资料目录
path = /data/Projects
browseable = yes
writable = yes
write list = Jack,John
valid users = %S
available = yes
[Tom]
comment = Tom's Stuff
path = /data/%U
write list = Tom
valid users = Tom
browseable = yes
available = yes
#======================= Global Settings ============================
[global]
workgroup = workgroup
security = user
server string = Samba
netbios name = Samba
socket options = TCP_NODELAY
max xmit = 65536
use sendfile = yes
os level = 1
passdb backend = smbpasswd
smb passwd file = /etc/samba/smbpasswd
username map = /etc/samba/smbusers
encrypt passwords = true
log level = 10
log file = /var/log/samba/%m.log
max log size = 200
deadtime = 30
keepalive = 60
store dos attributes = no
read raw = yes
write raw = yes
aio read size = 16384
aio write size = 16384
write cache size = 262144
getwd cache = yes
strict locking = no
create mask = 0644
directory mask = 0755
map to guest = bad user
#===================== Share Definitions ============================
[homes]
comment = Home Directories
path = /home
browseable = no
writable = yes
valid users = %S
[Public]
comment = 公共资料目录
path = /data/public
browseable = yes
writable = yes
write list = Tom
read list = Jack,John
available = yes
[Projects]
comment = 项目资料目录
path = /data/Projects
browseable = yes
writable = yes
write list = Jack,John
valid users = %S
available = yes
[Tom]
comment = Tom's Stuff
path = /data/%U
write list = Tom
valid users = Tom
browseable = yes
available = yes
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
這裡 提供兩個網頁 教你如何抓錯
https://help.ubuntu.com/community/Samba#Troubleshooting
先看看 能否幫你
每次碰到錯誤訊息
可以去這個 log file 找出錯誤訊息或原因
然後根據 錯誤訊息 的關鍵字
到上面兩個網頁 搜尋
可以比較快速找到有 幫助的資訊
這一篇 幫助你 解讀 /var/log/samba/%m.log
http://oreilly.com/openbook/samba/book/ch04_08.html
https://help.ubuntu.com/community/Samba#Troubleshooting
先看看 能否幫你
你這裡有設定 log filelog file = /var/log/samba/%m.log
每次碰到錯誤訊息
可以去這個 log file 找出錯誤訊息或原因
然後根據 錯誤訊息 的關鍵字
到上面兩個網頁 搜尋
可以比較快速找到有 幫助的資訊
這一篇 幫助你 解讀 /var/log/samba/%m.log
http://oreilly.com/openbook/samba/book/ch04_08.html
-
- 帖子: 39
- 注册时间: 2010-10-18 12:58
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
谢谢你的帮助,现在已经基本初步搞定我的服务器了,还没有投入使用。
还有两个疑惑:
1. 每个共享目录可以通过什么方法来限制使用空间吗?
2. 可以实现私人目录只对该私人用户可见,其他人不可见吗?
谢谢!
还有两个疑惑:
1. 每个共享目录可以通过什么方法来限制使用空间吗?
2. 可以实现私人目录只对该私人用户可见,其他人不可见吗?
谢谢!
-
- 帖子: 39
- 注册时间: 2010-10-18 12:58
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
我通过分别为每个用户创建配置文件的方式实现了,针对指定用户显示对应的共享目录。依然有两个疑惑:
1. 共享目录限制使用空间的方法;
2. 在共享目录中创建文件的权限问题:
如在[global]中添加的:
create mask = 0644
directory mask = 0755
这个如何理解,我好像遇到对两个用户都有读写权限的共享目录,但是第一个用户创建的文件,另一个用户却无法删除的情况,是不是可以通过这个参数来进行设置调整?
多谢!
1. 共享目录限制使用空间的方法;
2. 在共享目录中创建文件的权限问题:
如在[global]中添加的:
create mask = 0644
directory mask = 0755
这个如何理解,我好像遇到对两个用户都有读写权限的共享目录,但是第一个用户创建的文件,另一个用户却无法删除的情况,是不是可以通过这个参数来进行设置调整?
多谢!
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
指大小限制嗎 是這個嗎1. 共享目录限制使用空间的方法;
http://www.samba.org/samba/docs/using_samba/appb.html
max disk size = number
Sets the maximum disk size/free-space size (in megabytes) to return to the client.
這一篇還有許多 limit 的設定 可以參考
http://www.samba.org/samba/docs/using_samba/ch09.html2. 可以实现私人目录只对该私人用户可见,其他人不可见吗?
使用 browsable 搜尋看看
http://www.samba.org/samba/docs/using_samba/ch08.html在共享目录中创建文件的权限问题:
如在[global]中添加的:
create mask = 0644
directory mask = 0755
这个如何理解,
Creation Masks
File and Directory Permission Options
http://www.samba.org/samba/docs/using_samba/ch08.html第一个用户创建的文件,另一个用户却无法删除的情况,是不是可以通过这个参数来进行设置调整?
Locks and Oplocks
veto files
-
- 帖子: 39
- 注册时间: 2010-10-18 12:58
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
非常感谢您细心的指导,我将[global]中参数设置为:
create mask = 0644
directory mask = 0755
解决了第一个用户创建的文件,另一个用户却无法删除的情况;
但是,另一个问题:共享目录限制使用空间的方法的问题,我想实现的是对不同的共享目录分别设置不同的磁盘空间大小,但是您提供的那个链接,是在[global]参数中设置的max disk size = number,这个参数应该是针对所有用户帐号进行的使用空间大小的限制,就是说,任何一个用户往任何一个可以读写的共享目录中的提交文件大小,都受到这个参数的限制了。我想实现的目标是,针对为每个帐号分配的私有存储目录进行磁盘空间大小的限制,不对[Public]这类共享目录进行磁盘空间大小的限制,不知道这个可以实现吗?
谢谢!
create mask = 0644
directory mask = 0755
解决了第一个用户创建的文件,另一个用户却无法删除的情况;
但是,另一个问题:共享目录限制使用空间的方法的问题,我想实现的是对不同的共享目录分别设置不同的磁盘空间大小,但是您提供的那个链接,是在[global]参数中设置的max disk size = number,这个参数应该是针对所有用户帐号进行的使用空间大小的限制,就是说,任何一个用户往任何一个可以读写的共享目录中的提交文件大小,都受到这个参数的限制了。我想实现的目标是,针对为每个帐号分配的私有存储目录进行磁盘空间大小的限制,不对[Public]这类共享目录进行磁盘空间大小的限制,不知道这个可以实现吗?
谢谢!
-
- 帖子: 39
- 注册时间: 2010-10-18 12:58
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
这两个参数我改为:xjswwh 写了:
create mask = 0644
directory mask = 0755
create mask = 0777
directory mask = 0777
解决了那个一个用户创建的文件,另一个用户不能删除的问题。
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
看看 紅色字 這一段 給你什麼靈感但是您提供的那个链接,是在[global]参数中设置的max disk size = number,这个参数应该是针对所有用户帐号进行的使用空间大小的限制,就是说,任何一个用户往任何一个可以读写的共享目录中的提交文件大小,都受到这个参数的限制了。我想实现的目标是,针对为每个帐号分配的私有存储目录进行磁盘空间大小的限制,不对[Public]这类共享目录进行磁盘空间大小的限制,不知道这个可以实现吗?
http://www.faqs.org/docs/securing/chap29sec284.html
The first few lines of the file under the [global] line contain global configuration directives, which are common to all shares, unless they are over-ridden on a per-share basis, followed by share sections.
-
- 帖子: 39
- 注册时间: 2010-10-18 12:58
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
感谢您的回复,但是我按照那个提示做了以下验证:
1. 在[global]中设置 max disk size = 2
2. 分别在[Public]及[Projects]中设置 max disk size = 0
使用任意一个用户帐号进行登录,分别在用户帐号的私人目录及 Public、Projects共享目录中添加大于2M的文件,都会提示空间不足的提示。
是 unless they are over-ridden on a per-share basis, followed by share sections.这句话的意思我没有理解对?
另一个疑惑,就是我在smb.conf配置文件中添加[homes]与不添加这部分配置信息感觉没有什么区别,因为我没有把共享目录创建在home目录中,是不是可以不用在smb.conf配置文件中添加那部分[homes]信息?这部分内容不是必须的吧?
谢谢!
1. 在[global]中设置 max disk size = 2
2. 分别在[Public]及[Projects]中设置 max disk size = 0
使用任意一个用户帐号进行登录,分别在用户帐号的私人目录及 Public、Projects共享目录中添加大于2M的文件,都会提示空间不足的提示。
是 unless they are over-ridden on a per-share basis, followed by share sections.这句话的意思我没有理解对?
另一个疑惑,就是我在smb.conf配置文件中添加[homes]与不添加这部分配置信息感觉没有什么区别,因为我没有把共享目录创建在home目录中,是不是可以不用在smb.conf配置文件中添加那部分[homes]信息?这部分内容不是必须的吧?
谢谢!
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
1. 在[global]中设置 max disk size = 2
2. 分别在[Public]及[Projects]中设置 max disk size = 0
看看下面這一段另一个疑惑,就是我在smb.conf配置文件中添加[homes]与不添加这部分配置信息感觉没有什么区别,因为我没有把共享目录创建在home目录中,是不是可以不用在smb.conf配置文件中添加那部分[homes]信息?这部分内容不是必须的吧?
http://www.samba.org/samba/docs/using_samba/ch06.html
The [homes] share has been added to allow Samba to create a disk share for the home directory of each user who has a standard Unix account on the server.
試試 全部寫在 [homes] share ?
進一步參閱
1. http://www.samba.org/samba/docs/using_samba/ch06.html
The [ homes] Section
2. http://wiki.samba.org/index.php/Setting ... _the_share
Don't name the share „[homes]“, as this is a special section (see the smb.conf manpage)!
這裡的 [home] 跟上面的 [homes] 是不同的
-
- 帖子: 39
- 注册时间: 2010-10-18 12:58
Re: smb.conf 中 passdb backend 设置为 smbpasswd 时,无法访问samba服务器
谢谢,我认真看了下那几个链接,也尝试了将参数和路径都加入到[homes]下,还是没有成功,好像不能覆盖[global]下的那个max disk size参数,有些灰心了。我把我的最终配置信息贴出来,没有做使用空间限制的:
smb.conf 内容如下:
#======================= Global Settings ============================
[global]
workgroup = workgroup
security = user
server string = Samba Server Version %v
netbios name = Samba
socket options = TCP_NODELAY
max xmit = 65536
use sendfile = yes
os level = 1
passdb backend = smbpasswd
smb passwd file = /etc/samba/smbpasswd
username map = /etc/samba/smbusers
encrypt passwords = yes
log file = /var/log/samba/samba.log.%m
log level = 2
max log size = 200
deadtime = 30
keepalive = 60
store dos attributes = no
read raw = yes
write raw = yes
aio read size = 16384
aio write size = 16384
write cache size = 262144
getwd cache = yes
strict locking = no
create mask = 0777
directory mask = 0777
include = /etc/samba/%U.smb.conf
#===================== Share Definitions ============================
[homes]
comment = Home Directories
path = /home
browseable = no
writable = yes
valid users = %S
[Public]
comment = 公共资料目录
path = /data/Public
browseable = yes
writable = yes
write list = %U
read list = %U
available = yes
[Projects]
comment = 项目资料目录
path = /data/Projects
browseable = yes
writable = yes
write list = %U
read list = %U
available = yes
%U.smb.conf 这个引用的配置文件内容如下:
[Tom]
comment = Tom的私人目录
path = /data/Tom
write list = Tom
smb.conf 内容如下:
#======================= Global Settings ============================
[global]
workgroup = workgroup
security = user
server string = Samba Server Version %v
netbios name = Samba
socket options = TCP_NODELAY
max xmit = 65536
use sendfile = yes
os level = 1
passdb backend = smbpasswd
smb passwd file = /etc/samba/smbpasswd
username map = /etc/samba/smbusers
encrypt passwords = yes
log file = /var/log/samba/samba.log.%m
log level = 2
max log size = 200
deadtime = 30
keepalive = 60
store dos attributes = no
read raw = yes
write raw = yes
aio read size = 16384
aio write size = 16384
write cache size = 262144
getwd cache = yes
strict locking = no
create mask = 0777
directory mask = 0777
include = /etc/samba/%U.smb.conf
#===================== Share Definitions ============================
[homes]
comment = Home Directories
path = /home
browseable = no
writable = yes
valid users = %S
[Public]
comment = 公共资料目录
path = /data/Public
browseable = yes
writable = yes
write list = %U
read list = %U
available = yes
[Projects]
comment = 项目资料目录
path = /data/Projects
browseable = yes
writable = yes
write list = %U
read list = %U
available = yes
%U.smb.conf 这个引用的配置文件内容如下:
[Tom]
comment = Tom的私人目录
path = /data/Tom
write list = Tom