[Samba] Re: Understanding Samba Shares

A.J.Dawson A.J.Dawson at Bradford.ac.uk
Thu May 13 12:59:05 GMT 2004


Steve,

Here's how I got it all working:

Create the directory you want to share (you've already done this bit),
change the group ownership to be www-data and then chmod the folder
2775.  You should end up with a folder whose group ownership is www-data
and whose permissions are rwxrwsr-x, ie the setgid bit is set to cause
files to be owned by the group www-data.

Here's my share options in the smb.conf file:

[WWW-Data]
   comment = WWW-Data on %L
   volume = WWW-Data on %L
   writable = yes
   path = /var/www
   valid users = @www-data
   force group = www-data
   force create mode = 770
   force directory mode = 770
   create mask = 770
   directory mask = 770
   browseable = no

Map a drive to it and you should have a folder that is readable and
writable by anyone who is a member of the group www-data.

Note that you might want to modify the force create mode and force
directory mode settings depending on how many people access the share and
whether its on a live server (in which case the files need to be at least
world-readable as well).  You may also need to check whether group-write
permissions are enabled on folders already contained within your webroot.

I hope that helps!

Andy

Dr. Andy Dawson
A.J.Dawson at Bradford.ac.uk
http://www.mossie.org
http://www.museum-explorer.org.uk

 Never attribute to malice that which is adequately explained by stupidity.



> Message: 18
> Date: Wed, 12 May 2004 09:57:16 -0700
> From: "Steven Sheeley" <ssheeley at myndworx.com>
> Subject: [Samba] Understanding Samba Shares
> To: samba at lists.samba.org
> Message-ID: <WorldClient-F200405120957.AA57160043 at myndworx.com>
>
> I've searched every archive and read the documentation and I still can not figure out how to do this.
>
> I've recently installed Debian 3.0 (woody) on a box and have setup Samba on it.  I can see it from my WinXP box just
> fine and I have a user on the Debian box that's the same as my user name and PW on the WinXP box. I can read/write and
> do everything from my 'Home' share automatically setup by samba and that's working just fine.
>
> Where I am dropping the ball is in creating another share that I as normal user can write to.  I do my web page work
> on my WinXP system and want to share the /var/www directory so that I can directly open my php and html files with my
> editor on the WinXP system and not have to maintain two copies or more, elsewhere and FTP them back and forth.
>
> I've setup the share using the examples I've found on the net and I can see the share and even read the files there,
> but I can not write to them.
>
> The /var/www directory is owned by group www-data, of which my normal user on the Debian machine is a member of.
>
> I'm completely stuck here, can anyone point me in the write [get it?  ;-)] direction so that I can read and write to
> that shared
> dir with my WinXP box?
>
> Thanks in advance
> Steve







More information about the samba mailing list