LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-15-2005, 02:08 PM   #1
NuLLiFiEd
LQ Newbie
 
Registered: Oct 2003
Posts: 19

Rep: Reputation: 0
Help required with samba... deny delete but allow write?


Hi there,

Is there a way to allow some user write access to a share but deny delete?The users will need write access to some folders but since everyone logs in to linux/samba share with the same username and password (dumb people, they dont like different users/passwords), they will sometime try to delete other's files.So is there a samba config directive so lets say user TOM has write access to \\somemachine\SHARE but he cannot delete what he already copied there? I hope I made myself pretty clear, if not, excuse me, im typing after 16 hours of work.Thank you
 
Old 06-16-2005, 11:40 AM   #2
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
you could use the "sticky bit" trick. I don't quite remember, but I think this permission bit make sure no one can delete a file but the owner. With samba, you could make sure the owner is always "someone" even if your clients are using "anyone".
You can set this with "chmod 1755 a_file" as example. Of course, you will have to set something like this as default permission in samba.

Do some search about it, I'm not quite sure if I am telling you total bs or if my memory is right. Search about forth permission byte (mean : UID = 4XXX, GID = 2XXX, SID = 1XXX )
 
Old 07-04-2005, 03:49 PM   #3
dar28ek
LQ Newbie
 
Registered: Jul 2005
Posts: 10

Rep: Reputation: 0
I think sticky bit doesn't help, because if the sticky bit is set, the owner of a file still can delete it. In this situation all the people are logged with the same login, so they all are the owners of files they create. I have exactly the same problem and I have not found the solution yet.
 
Old 07-04-2005, 03:57 PM   #4
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
As I said, you could set samba so that ALL files created belong to a certain user (let's call it samba_user) even if they are created by another user (bill, bob, joe).

So even if "Bill", "Bob" or "Joe" create a file with permission 777 (read/write/execute) they won't be able to delete it because it will be owned by "samba_user" and so with sticky bit, only "samba_user" will be able to remove it.
 
Old 07-04-2005, 04:14 PM   #5
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Do you have many Linux users connecting to a share on a Windows box or the obverse? Since the "sticky bit" is only availabe on Linux file systems, I suspect the later; but, in the former case, I think you can do it with NTFS permission settings.

On the other hand, again, just a thought, but arn't FTP sites sometimes set up with "no delete" permissions on their upload directories? If so, you might be able to see how they do it, and adapt that sceme to you situation.

One other thought: I everyone is connecting using the same userid, how can you tell that TOM instead of JERRY created any specific file? If you can't tell them apart on the server side of the Samba wall, I don't see that you have any hope of solving your problem.

If you can distingush TOM from JERRY, why not set up differen account on the server for them, and proxy a connection (through localhost) for them in their own account. You wouldn't even have to tell them that they had accounts on the server . . .

Just a vague thought, sorry it doesn't help much -- "The devil is in the details."
 
Old 07-04-2005, 04:53 PM   #6
dar28ek
LQ Newbie
 
Registered: Jul 2005
Posts: 10

Rep: Reputation: 0
Sorry Half_Elf. I understood the next part of your previous post after the same idea occured to me: to make the owner of all files the same person for example "root".
I have samba on a linux server and a few different windows clients (xp, 95, 98). So far I am trying to test it on one client with xp. Is the sticky bit useful in this case?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Get permission to write/delete it-s Linux - Newbie 12 02-16-2005 04:30 AM
NTFS write and delete...... AzuuAz Linux - Software 3 11-26-2004 03:38 AM
samba guest directory once write then no delete ilnli Linux - Networking 1 08-30-2004 01:36 AM
samba share with write but not delete Red Squirrel Linux - Software 7 08-29-2004 06:12 PM
Deny access to samba on eth1 smurf Linux - Networking 2 06-20-2001 08:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration