|  |
02-16-2009, 11:20 PM
|
#1 (permalink)
|
Monster Techie Join Date: Sep 2005 Location: /home/jason Posts: 1,826
| Auto-Assigning group permissions to files put in directories? The Situation: I have a "Public" folder shared out via Samba that I use for transferring certain things to other computers. This Public folder is assigned 775 rights to the folder + all items inside with the owner being jason and the group being sambashare.
The Problem: When I drop a new file in, it takes on "jason:jason" rights instead of "jason:sambashare" rights. It also doesn't get assgined 775 permissions either.
Solution Needed: I want to drop files into this public folder and for them to take on the EXACT permissions/rights as the parent folder (aka the public folder). |
| |
02-17-2009, 09:06 AM
|
#2 (permalink)
|
Join Date: Jul 2005 Location: England Posts: 2,161
| Re: Auto-Assigning group permissions to files put in directories? The force create mode is the minimum permissions set so you could get 777.
In smb.conf you need
force user = jason
force group = sambashare
force create mode = 0775
Both the user and the group need to exist so create the sambashare group if you have not done already.
__________________ MSI P43 Neo|Enermax Pro82+ 425W|E5200|silent 8500GT|250GB Samsung spinpoint F1|Samsung SATA DVD RW|4GB Corsair|Antec SOLO|openSUSE11 
There are in order of increasing severity: lies, darn lies, statistics, and computer benchmarks. - diskinfo man page |
| |
02-17-2009, 06:21 PM
|
#3 (permalink)
|
Monster Techie Join Date: Sep 2005 Location: /home/jason Posts: 1,826
| Re: Auto-Assigning group permissions to files put in directories? Right. But I'm not asking about how to do it in Samba. Sure, Public is a Samba shared folder, but Public is a folder on my LOCAL computer, so when I drop files into it it takes permissions of jason:jason (user on the Linux PC).
If I transfer things to/from the Public folder from the other computers, it's fine, because THEN I'm working through Samba. But I'm on my local computer, so Samba has no involvement from the perspective I'm working with right now. |
| |
02-17-2009, 07:28 PM
|
#4 (permalink)
|
Join Date: Jul 2005 Location: England Posts: 2,161
| Re: Auto-Assigning group permissions to files put in directories? You could try mounting the samba share. eg. /media/shares/myshare is your shared directory so something like `mount -t cifs //127.0.0.1/myshare /home/jason/myshare`. I'm not entirely confident but there's no harm in trying. In the mean time, I'll try and think of something better, or maybe someone else has an idea already.
__________________ MSI P43 Neo|Enermax Pro82+ 425W|E5200|silent 8500GT|250GB Samsung spinpoint F1|Samsung SATA DVD RW|4GB Corsair|Antec SOLO|openSUSE11 
There are in order of increasing severity: lies, darn lies, statistics, and computer benchmarks. - diskinfo man page |
| |
02-17-2009, 11:29 PM
|
#5 (permalink)
|
Monster Techie Join Date: Sep 2005 Location: /home/jason Posts: 1,826
| Re: Auto-Assigning group permissions to files put in directories? I don't mount the drives via a command. I added the drives to fstab so they all mount upon startup. So my secondary 250gb drive, which I consider my network drive since it houses all of the Samba shares (including public) gets mounted upon bootup. The thing is, to ME on this computer, the hard drive is local... whereas to other users, it's a network drive to them. So my dilemma isn't Samba, it's local.  Thanks for the input, though. Hopefully there's a way around this! Otherwise I'll just have to hit "apply permissions to files inside" on the permissions tab of that folder... |
| |
02-18-2009, 12:31 AM
|
#6 (permalink)
|
True Techie Join Date: Dec 2008 Location: Rx Counter Posts: 147
| Re: Auto-Assigning group permissions to files put in directories? Quote:
Originally Posted by Jayce I don't mount the drives via a command. I added the drives to fstab so they all mount upon startup. So my secondary 250gb drive, which I consider my network drive since it houses all of the Samba shares (including public) gets mounted upon bootup. The thing is, to ME on this computer, the hard drive is local... whereas to other users, it's a network drive to them. So my dilemma isn't Samba, it's local.  Thanks for the input, though. Hopefully there's a way around this! Otherwise I'll just have to hit "apply permissions to files inside" on the permissions tab of that folder... | Well you could make a cron script that runs on bootup and or periodically (if you dont shut down alot, i assume you dont since your on linux) and it would just chmod the folder recursively every-so-often (once an hour/half-hour? its a simple operation so its not like it would kill your resources, I imagine)
Dont know if this is feasible to you, seemed to pop into my head tho :-P
__________________ Dr. House
--------------------------------------------------
Antec 900, P5K SE, E8400 "Wolfdale" 4.06GHz, Tuniq Tower, 4Gb GSkill DDR2 891, WD Caviar SE16 250, Radeon 4670 HD, WD Raptor WD1500ADFD (for sale, ~$900)
Thinkpad T61 CTO 2.2 Ghz Core 2 Duo, 2 gig, 100 gig 7200 RPM, 15.4" wide screen (for sale ~$800)
MacBook Pro C2D 2.2GHz 4 gig, 100 gig 7200 RPM
PowerBook G4 Aluminum |
| |
02-23-2009, 11:37 AM
|
#7 (permalink)
|
True Techie Join Date: Dec 2008 Location: Rx Counter Posts: 147
| Re: Auto-Assigning group permissions to files put in directories? Quote:
Originally Posted by Dr.House Well you could make a cron script that runs on bootup and or periodically (if you dont shut down alot, i assume you dont since your on linux) and it would just chmod the folder recursively every-so-often (once an hour/half-hour? its a simple operation so its not like it would kill your resources, I imagine)
Dont know if this is feasible to you, seemed to pop into my head tho :-P | I take it you had some/no luck with this?
__________________ Dr. House
--------------------------------------------------
Antec 900, P5K SE, E8400 "Wolfdale" 4.06GHz, Tuniq Tower, 4Gb GSkill DDR2 891, WD Caviar SE16 250, Radeon 4670 HD, WD Raptor WD1500ADFD (for sale, ~$900)
Thinkpad T61 CTO 2.2 Ghz Core 2 Duo, 2 gig, 100 gig 7200 RPM, 15.4" wide screen (for sale ~$800)
MacBook Pro C2D 2.2GHz 4 gig, 100 gig 7200 RPM
PowerBook G4 Aluminum |
| |
02-23-2009, 06:47 PM
|
#8 (permalink)
|
Monster Techie Join Date: Sep 2005 Location: /home/jason Posts: 1,826
| Re: Auto-Assigning group permissions to files put in directories? I just don't use the public folder that much to warrant a script to run automatically. It was one of those things that wasn't a big deal, but I was still curious enough to see "if it was possible." Thanks for the input, though! |
| |  | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | |