Samba 在 xbmc 上不需要密码,但在 ubuntu 上需要

Samba 在 xbmc 上不需要密码,但在 ubuntu 上需要

我在 Fedora 13 机器上安装了 Samba,并用它与家庭娱乐室中的 xbmc 客户端共享。当我设置它时,不需要密码或任何其他东西,我只需输入以下路径:

smb://<host>/<share> and all worked. 

现在,在我的 ubuntu 10.04 机器上,当我尝试访问相同的主机时,例如通过 smbmount,但我收到错误。

smbmount //media/Music ~/Music/  # media is in my /etc/hosts and resolves to 
                                 # correct IP address for the machine

当系统提示输入密码时,按下回车键后出现错误:操作不允许。

这是我从 /etc/samba/smb.conf 中输入的内容:

[global]

workgroup = WORKGROUP
server string = Samba Server Version %v


# log files split per-machine:
log file = /var/log/samba/log.%m
# maximum size of 50KB per log file, then rotate:
max log size = 50



security = user
passdb backend = tdbsam


;   security = domain
;   passdb backend = tdbsam
;   realm = MY_REALM

;   password server = <NT-Server-Name>

;   security = user
;   passdb backend = tdbsam

;   domain master = yes
;   domain logons = yes

;   logon script = %m.bat
;   logon script = %u.bat
;   logon path = \\%L\Profiles\%u
;   logon path =

;   add user script = /usr/sbin/useradd "%u" -n -g users
;   add group script = /usr/sbin/groupadd "%g"
;   add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s     /bin/false "%u"
;   delete user script = /usr/sbin/userdel "%u"
;   delete user from group script = /usr/sbin/userdel "%u" "%g"
;       delete group script = /usr/sbin/groupdel "%g"

;   local master = no
    ;   os level = 33
    ;   preferred master = yes

;   wins support = yes
;   wins server = w.x.y.z
;   wins proxy = yes

;   dns proxy = yes


    load printers = yes
    cups options = raw

;   printcap name = /etc/printcap
    # obtain a list of printers automatically on UNIX System V systems:
;   printcap name = lpstat
;       printing = cups

;   map archive = no
;       map hidden = no
;   map read only = no
;   map system = no
;   store dos attributes = yes


#============================ Share Definitions ==============================

[homes]
comment = Home Directories
browseable = no
writable = yes
;   valid users = %S
;   valid users = MYDOMAIN\%S


# Un-comment the following and create the netlogon directory for Domain Logons:
;   [netlogon]
;   comment = Network Logon Service
;   path = /var/lib/samba/netlogon
;   guest ok = yes
;   writable = no
;   share modes = no

# Un-comment the following to provide a specific roving profile share.
# The default is to use the user's home directory:
;   [Profiles]
;   path = /var/lib/samba/profiles
;   browseable = no
;   guest ok = yes

# A publicly accessible directory that is read only, except for users in the
# "staff" group (which have write permissions):
;   [public]
;   comment = Public Stuff
;   path = /home/samba
;   public = yes
;   writable = yes
;   printable = no
;   write list = +staff

    [tv]
comment = TV
    path = /media/Isos/tv
    public = yes
    writable = yes
    printable = no
    write list = +media

    [music]
comment = Music
    path = /media/Storage/music/ 
    public = yes
    writable = yes
    printable = no
    write list = +media


    [pictures]
    comment = Pictures
    path = /media/Storage/pictures
    public = yes
    writable = yes
    printable = no
    write list = +media

答案1

也许这会有所帮助: 如何:永久挂载 smbfs 共享

答案2

您的 samba 可能设置为将无效用户映射到来宾帐户。最有可能的是,您的 xbmc 使用的xbox用户名在您的 samba 服务器上是无效的。当您从另一个 linux 机器访问时,该用户名可能是有效的。检查global您的 部分smb.conf

[global]
# This option controls how unsuccessful authentication attempts are mapped 
# to anonymous connections
   map to guest = bad user

如果您想像 xbmc 一样访问它,您可以添加选项来指定用户名。

smbmount //media/Music ~/Music/ -o username=xbox

请注意,在当前配置中,访客被授予只读访问权限。如果您想写入,您可以:

  1. 允许客人写入(潜在危险)

  2. 添加具有写权限的用户,并以该用户身份登录。 向 Samba 添加用户

答案3

您可能想要尝试“访客”选项,特别是当只需要只读访问权限时。


那么你有两个选择

1. 仅对访客可读(无需身份验证),但如果您在映射共享时进行身份验证,则可以读/写
2. 访客可读/写,然后任何人都可以写入共享并更改其上的所有内容


啊,你运行该 mount 命令的用户帐户是否有权挂载目录?我怀疑没有。你可能必须将其与选项一起添加到文件user/etc/fstab

//media/Music /path/to/Music smbfs noauto,user,soft 0 0

这就是我的观点 - 将其添加到 fstab,否则只有 root 可以挂载文件系统 - 这几乎肯定是错误的根源。

相关内容