You are not logged in.

#1 2011-01-23 19:20:44

Captain Dunce
Member
Registered: 2011-01-14
Posts: 23

[SOLVED]cannot share folder in home directory with SAMBA

My problem is relatively small as I can use a workaround but I would like to be able to discern whether or not my troubles  stem from a bug or my own incompetence. 

Basically it seems I can share just about anything I want EXCEPT for a file or folder in my home directory.  I  have two primary users on my box, root & dunce, and what I am unable to do is share "/home/dunce/shared".  I've tried quite a few different configs based on what I could find online but nothing works.  Initially I followed the SAMBA instrucions on the Arch Wiki and that was fine for other items I wanted to share.  I feel like I'm kinda'   makin' a mountain out of a molehill here but I would really like to understand WHY I can't share from "/home/dunce/shared".  I really don't think it's a problem in smb.conf but then again . . .  Any insight would be greatly appreciated.

Last edited by Captain Dunce (2011-01-24 07:11:06)

Offline

#2 2011-01-23 20:00:49

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: [SOLVED]cannot share folder in home directory with SAMBA

You should check the file permissions on your home directory.
If you want to share a file or folder within you home folder you probably need to chmod the folder to include the execute bit on the folder permissions.

Could be something like this:

chmod o+x /home/dunce

MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#3 2011-01-23 20:03:59

Captain Dunce
Member
Registered: 2011-01-14
Posts: 23

Re: [SOLVED]cannot share folder in home directory with SAMBA

I did chmod the directory rwx.  The permissions seem OK.

Offline

#4 2011-01-23 20:33:35

Captain Dunce
Member
Registered: 2011-01-14
Posts: 23

Re: [SOLVED]cannot share folder in home directory with SAMBA

Not sure about this.  I can share my ENTIRE home directory but for some reason I can't just specify ONE or TWO folders.  It's just really frustrating to not understand WHY.

Offline

#5 2011-01-23 21:32:22

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: [SOLVED]cannot share folder in home directory with SAMBA

Only being able to share the entire home folder sounds a bit odd.
We need to find out if it is samba or the linux permissions who is teasing us here.

If you make a folder underneath your home folder, and give it rwx permissions to everyone. Can you share that folder?

example:

mkdir ~/sharefolder
chmod 777 ~/sharefolder

And then share it with samba

[share]
  path = /home/dunce/sharefolder
  browseable = yes
  writable = yes

Does that work?


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#6 2011-01-24 00:58:10

Captain Dunce
Member
Registered: 2011-01-14
Posts: 23

Re: [SOLVED]cannot share folder in home directory with SAMBA

The share shows up in nautilus but keeps asking for a password even though I never "conscioulsy" set one.  I tried every password associated with myself and root to no avail.  I set security = share in smb.conf and chmod 777 /home/dunce/shared.   I did get it to work using SWAT, but I would still like to know what I did wrong.  I'm using the default smb.conf with only 1 share added and the change in security = share.  I just don't know what I did and where.

Offline

#7 2011-01-24 05:09:46

Captain Dunce
Member
Registered: 2011-01-14
Posts: 23

Re: [SOLVED]cannot share folder in home directory with SAMBA

All right, progress.  I've discovered that removing the "browseable = yes" line from my share entry in smb.conf now allows me to access the share through nautilus.  I tried just changing the line to "browesable = no" but that didn't work either.  However I would still appreciate some insight as to why the "browseable" line in smb.conf causes that particular issue with nautilus.  I will mark this thread as solved by midnight US/Pacific time.

Offline

#8 2011-01-24 08:25:20

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: [SOLVED]cannot share folder in home directory with SAMBA

The option browseable if not defined is per default set to yes.

Excerpt from The definitive guide to samba 3
browseable: This parameter determines whether a share appears in browse lists on clients. The default value of YES causes a share to appear and is usually appropriate. You can hide a share by setting this parameter to NO; however, be aware that this setting doesn't make a share unavailable, only hidden from casual browsing.

Another thing I stumbled upon is that samba can get confused if security=share is used. It will try different usernames until it finds one that can be used, or will deny access if none can be used. The following list is the order it tries to access the share:
Guest, Client provided username, Prior login, Share name, Client name, User list (if defined).

You can try to set

guest ok = yes

and see if that changes the behaviour. You will need

guest account = nobody

or something similar in you global configuration to make this work.

Whatever user you set as guest need to exist in the samba database. And must be a existing linux username as well.


Another option is to set the guest account in the share definition and only allow guest access.

[share]
  path = /home/dunce/sharefolder
  browseable = yes
  writable = yes
  guest account = dunce
  guest ok = yes
  guest only = yes

Again the username (dunce) need to exist in the samba database. Depending on your setup this can be set with the command pdbedit.

There is a samba book available online from O'Reilly. It is a bit dated, but the info on shares should still be valid. I think chapter 6 is especially interesting for you in your scenario.
http://oreilly.com/catalog/samba/chapte … index.html


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

Board footer

Powered by FluxBB