• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Samba read write permissions?

Concillian

Diamond Member
Anybody know samba well enough to know how to set user level read/write permissions on specific shares?

I am reasonably well versed in my own smb.conf file I have a home fileserver that I run a Raid 5 IDE array on. I have user folders, which are easy, as these can be non-browsable, and I can specify ONLY the correct user to have access to it. That's no problem.

What I want is for some shares to have guest/public level read permission, but write level permission restricted to only a few users... essentially the equivalent of a chmod 775

Basically what I'd like to do is have the fileserver available at a LAN Party for getting patches, maps, etc..., but not have to worry about people mucking about with my files, while still having the ability to download files from the internet to the fileserver if I need to.

Thanks for any help.
 
Not sure exactly what to do in this situation.

On stuff like NFS mount you are usually able to set the uid and gid of the mounted partition. So you could do something like create a smbgroup add the people you want to it and set the uid to root or nobody and the group to smbgroup and then set the umask of the files you mounted.

I looked in the man file for mount and it said that it doesn't deal with smbfs and passes the buck onto smbmount or whatever you use to mount SMB shares. Unfortunately I don't have SAMBA installed right now to look but you ought to be able to find something out in the man smbmount command.

something I suspect like:

mount -t smbfs -o uid=nobody,gid=sbmgroup,umask=002 servername:sharename /smb/mount/point/

But it's pretty rare that I have to deal with this sort of thing, so I am not sure if that will work. Then once you get that figured out you just add the mount and options and stuff to your /etc/fstab file so that you don't have to type that junk out each and every time.


EDIT:

Oops, read you wrong. I was thinking that you were mounting a share... not sharing a share. I'll get back to you in a little bit with a better answer, hopefully.

EDIT#2:

What may be better actually then a SMB share, would be to set up a anonymous FTP server. Then if you want to make it easier setup your DNS server for your lan with a simple hostname pointing to your file server if that's simple thing to do.

Then they would just open up IE or whatever and type ftp://fileserver. Then that's easy, it's fast and you don't have to worry about people mucking around with your files.

Then you can just set SMB like it normally operates with a password and whatnot and let it be done that way.

Hell even set up a simple webserver or something. That would be easy to do, and the html is easy to take care of. Something like a bash script for the files you want to share:

(from the directory your sharing files from, you setup a simple page with the <HTML> and <HEAD><BODY> type stuff and go:

ls | while read i; do echo '<a href="'"$i"'">'"$i"'</a><br>' ; done >> sample.html

That way your quickly able to generate a html index of the files in your directory that are aviable to download. A little tweaking and it would be perfect for almost any directory setup... (of course with a html generating script that simple you'd have to go in and delete any lines that contain links to directories and whatnot.

(it would also be fun thing to setup something like Icecast to have a little network based mp3 streaming radio station and let everybody play it on their own computer speakers, or set up a videolan server and send streaming movies and stuff like that and put links to those streams on your webserver along with links to the files.)
 
Here is an example of a samba share (version 3.0.2a) that allows guest reading, but only write permission to a specific user:

[webdrive]
public = yes
path = /var/www
write list = kil
allow hosts = 192.168.1.100
 
Back
Top