You are not logged in.

#1 2013-05-04 10:45:25

Kaihnn
Member
Registered: 2013-05-04
Posts: 2

Samba share without password not accessible

Hi !

First of all, excuse my english tongue

I had a fileserver under debian, but i wanted to switch it under Archlinux. But when I installed samba, i saw that security = share was deprecated (I use samba 4.0.5-1). I read this article http://vicidi.wordpress.com/2012/01/23/ … y-setting/ to resolve my problem. But it didn't work : I can't access my directories. I did see them, but when I try entering in, i get a message "Windows can't access \\ALPAGA\films"

I tried with a username/password connection and it works, but as soon as I connect with guest account, it fails.

/etc/smbusers

samba = guest

/etc/samba/smb.conf

[global]
        server string = alpaga
        passdb backend = tdbsam
        guest ok = Yes
        map to guest = Bad User
        username map = /etc/samba/smbusers
        security = user

[films]
        comment = films
        path = /mnt/raid/films
        read only = No

...

samba user have access to content of /mnt/raid/films, but here is my config just in case..

ls -la /mnt/raid

drwxrwx---   5 root   users 12288  4 mai   12:03 films
drwxrwx---   2 root   users 16384  5 mai    2012 lost+found
...

/etc/group

...
users:x:100:kaihnn,samba,xbmc,pyload,transmission,nobody
...

Last edited by Kaihnn (2013-05-04 10:47:44)

Offline

#2 2013-05-04 11:22:05

Raynman
Member
Registered: 2011-10-22
Posts: 1,073

Re: Samba share without password not accessible

I don't think you want the username map. The author of that blog post seems to think that the map is responsible for mapping bad users to the unix user nobody, but that is what 'guest account' is for. This defaults to nobody, so it works in his case.

You also have nobody in the users group (do you really want that?) so that should still give you access when the user you are using gets mapped to the guest account. Note that only users that do not exist in your passdb will be mapped to the guest account (or you could use 'map to guest = Bad Password'). A common mistake is to have strange combinations of samba users/passwords and normal unix users.

So are you sure the user gets mapped to guest (=nobody until you change your config)? Can the logs provide any clues about this? (maybe increase log level, I don't remember exactly what samba logs)

Offline

#3 2013-05-04 11:59:44

Kaihnn
Member
Registered: 2013-05-04
Posts: 2

Re: Samba share without password not accessible

Thanks for your answer. I changed files like this :
/etc/samba/smb.conf

[global]
        server string = alpaga
        idmap config * : backend = tdb
        security = users
        guest ok = Yes
        map to guest = Bad User
        guest account = samba
        #username map = /etc/samba/smbusers
        #valid users = samba
        log level = 3

[films]
        comment = films
        path = /mnt/raid/films
        read only = No

Here are a part of the logs.

/var/log/samba/log.smbd

[2013/05/04 13:39:18.083514,  1] ../source3/smbd/service.c:847(make_connection_snum)
  lay (ipv4:192.168.0.12:53543) connect to service films initially as user samba (uid=1001, gid=1001) (pid 347)
[2013/05/04 13:39:18.084101,  3] ../source3/smbd/service.c:197(set_current_service)
  chdir (/mnt/raid/films) failed, reason: Permission non accordée

It seems guest is mapped to user "samba", but still no permission on chdir.

Offline

Board footer

Powered by FluxBB