You are not logged in.

#1 2013-07-28 06:09:50

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

[solved] Can access samba share /home/user/Share from windows

Hi,
I'm setting up samba from my Archlinux server, and it's to be shared with my windows laptop.
I followed the wiki and configured by using SWAT. I've been trying various configurations for 2 days.
\\archbox is browseable and I can see 'Share' folder there, but for accessing \\archbox\Share, Windows gave me the error:

You do not have permission to access \\archbox\Share.

smb.conf (where user 'samba' belongs to 'users' group, and has a password):

[global]
        dos charset = CP936
        server string = Archbox
        interfaces = 192.168.1.0/24
        bind interfaces only = Yes
        map to guest = Bad User
        guest account = samba
        log file = /var/log/samba/%m.log
        max log size = 50
        server min protocol = SMB2
        client max protocol = SMB3
        client min protocol = SMB2
        socket options = TCP_NODELAY IPTOS_THROUGHPUT
        load printers = No
        printcap name = /dev/null
        disable spoolss = Yes
        dns proxy = No
        idmap config * : range =
        idmap config * : backend = tdb
        force create mode = 0775
        force directory mode = 0775
        printing = bsd

[Share]
        comment = Archbox Share
        path = /home/nanw/Share
        read only = No
        guest ok = Yes

ls -l /home/nanw/Share

drwxrwxr-t 16 nanw users 4.0K Jul 26 23:44 Share/

smbclient -L archbox

protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE

Please help the desperate newbie in Samba.

Last edited by enihcam (2013-07-29 11:32:56)

Offline

#2 2013-07-28 06:30:21

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] Can access samba share /home/user/Share from windows

If you check out the file /etc/samba/smb.conf.default it will give you an example of how to create a public share. 

Although SWAT might have some good aspects to it, I think that samba is best configured by hand editing the config file. It is very well documented. I think that in the event that there is an example (or default) config provided by a package, you should always reference that if you run into issues.  Also, the man page for any program is also a good reference.  Again, the samba package (and smb.conf man page in particular) provides some excellent documentation.

Offline

#3 2013-07-28 07:38:24

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

Re: [solved] Can access samba share /home/user/Share from windows

WonderWoofy wrote:

If you check out the file /etc/samba/smb.conf.default it will give you an example of how to create a public share. 

Although SWAT might have some good aspects to it, I think that samba is best configured by hand editing the config file. It is very well documented. I think that in the event that there is an example (or default) config provided by a package, you should always reference that if you run into issues.  Also, the man page for any program is also a good reference.  Again, the samba package (and smb.conf man page in particular) provides some excellent documentation.

I configured through SWAT, but for *every entry* I looked for its meaning in 'man smb.conf'.

I checked. not only win8 laptop cannot access the share, but also my another win7 box cannot.

Last edited by enihcam (2013-07-28 07:43:41)

Offline

#4 2013-07-28 15:21:20

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] Can access samba share /home/user/Share from windows

Did you look at what was in the example smb.conf.default file?  I don't doubt you tried to do your best in making sure that you were using valid configurations. But it is apparently not working, so there must be something that is wrong.  So since you made no indication of whether or not you checked, here is what it suggest for the creation of a public share:

$ cat /etc/samba/smb.conf.default
<snip>
;[public]
;   comment = Public Stuff
;   path = /home/samba
;   public = yes
;   read only = yes
;   write list = @staff
<snip>

If course, if you want to make it world writable that is fine.  But just in case you wanted to have a touch of security in your setup, and ensure that not just anybody can connect to this share and delete everything, the use of a group with the "write list" configuration is a good idea.  Of course, the ';' are comment lines.

So hopefully this helps.  The next time you ask for help on a forum like this, and someone tries to guide you where to look for the answer... it might be good to actually go look there.

Offline

#5 2013-07-29 00:13:32

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

Re: [solved] Can access samba share /home/user/Share from windows

WonderWoofy wrote:

Did you look at what was in the example smb.conf.default file?  I don't doubt you tried to do your best in making sure that you were using valid configurations. But it is apparently not working, so there must be something that is wrong.  So since you made no indication of whether or not you checked, here is what it suggest for the creation of a public share:

$ cat /etc/samba/smb.conf.default
<snip>
;[public]
;   comment = Public Stuff
;   path = /home/samba
;   public = yes
;   read only = yes
;   write list = @staff
<snip>

If course, if you want to make it world writable that is fine.  But just in case you wanted to have a touch of security in your setup, and ensure that not just anybody can connect to this share and delete everything, the use of a group with the "write list" configuration is a good idea.  Of course, the ';' are comment lines.

So hopefully this helps.  The next time you ask for help on a forum like this, and someone tries to guide you where to look for the answer... it might be good to actually go look there.

Sorry I was in a bad mood because of this issue. I apologize.

I changed

[Share]
        comment = Archbox Share
        path = /home/nanw/Share
        read only = No
        guest ok = Yes

to

[public]
        comment = Archbox Share
        path = /home/nanw
        read only = yes
        public = yes
        write list = samba

It didn't work.

Offline

#6 2013-07-29 02:20:19

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

Re: [solved] Can access samba share /home/user/Share from windows

I captured some packets during the smb negotiation, and sent to a samba guy for analysis. He said the connection had no problem. The authentication passed but the local folder denied the access.

Offline

#7 2013-07-29 02:41:49

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] Can access samba share /home/user/Share from windows

What are the permissions of the directory in question?  Maybe you have the "other" set to not have access?

Offline

#8 2013-07-29 04:52:20

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

Re: [solved] Can access samba share /home/user/Share from windows

WonderWoofy wrote:

What are the permissions of the directory in question?  Maybe you have the "other" set to not have access?

/home/nanw/Share:

drwxr-xr-x   4 root root 4.0K Jul 14 09:59 home/
drwx------ 19 nanw users 4.0K Jul 28 19:43 nanw/
drwxrwxr-t 16 nanw users 4.0K Jul 26 23:44 Share/

You might be right. I granted the permission to access Share, but not its parent directory, nanw.

Let me try when I get home.

Offline

#9 2013-07-29 11:37:27

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

Re: [solved] Can access samba share /home/user/Share from windows

Yes, after 'chmod 710 /home/nanw', the share can be accessed.


Here's one extra issue:

If I remove all permissions for 'others', say

drwxrwxr-t 16 nanw users 4.0K Jul 26 23:44 Share/

to

drwxrw---T 16 nanw users 4.0K Jul 26 23:44 Share/

/home/nanw/Share CANNOT be accessed again.

I don't understand. 'samba' is in group 'users', which shares the same group with 'nanw'. How come the permission from 'others' affect the access?

Last edited by enihcam (2013-07-29 11:38:38)

Offline

Board footer

Powered by FluxBB