LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Need suggestions on samba setup (https://www.linuxquestions.org/questions/linux-server-73/need-suggestions-on-samba-setup-540230/)

jakev383 03-24-2007 01:17 PM

Need suggestions on samba setup
 
I have need to set up a samba share where users can add/modify files all they want, but nobody will be able to delete files without a password. It'd be nice to keep a log of who deleted what and when if possible.
Worst case is setup samba to move the files a user wants to delete to a "trash bin" to be deleted by an admin later.
Has anyone setup anything similar? I currently run 2 samba shares - on one all users use the same user/pass (guest ok) where they have full access. I have another where a separate user/pass is used by all users that only a few users have access to.
All users are of course running XP Home or Pro, with no domain controller present.
Thanks in advance.

lavacano201014 03-24-2007 08:18 PM

I haven't even got Samba to WORK on my machine here, but try surfing through any and all configuration files and interfaces. Set a nodelete somewhere and do that "trash bin" thing.

jakev383 03-29-2007 07:53 AM

Quote:

Originally Posted by jakev383
I have need to set up a samba share where users can add/modify files all they want, but nobody will be able to delete files without a password. It'd be nice to keep a log of who deleted what and when if possible.
Worst case is setup samba to move the files a user wants to delete to a "trash bin" to be deleted by an admin later.
Has anyone setup anything similar? I currently run 2 samba shares - on one all users use the same user/pass (guest ok) where they have full access. I have another where a separate user/pass is used by all users that only a few users have access to.
All users are of course running XP Home or Pro, with no domain controller present.
Thanks in advance.

To answer my own post:
I set up a "recycle bin" for the network share using VFS for Samba (built in on the CentOS version, may be on others as well). I created a share called "Trash" and then created a symlink to it into the user's network share as a hidden file (.deleted). VFS takes the file when a user deletes it and moves it to the .deleted folder (which is symlinked to the recycle folder). I then access the "Trash" share as another mapped drive and can manually delete files, thus stopping the accidential deleteion of files by users. Here's my shares setup in my smb.conf:

[Home Share]
comment = Home Share
path = /rd0/home-share
writeable = yes
guest ok = yes
read only = no
public = yes
hide dot files = yes
follow symlinks = no
vfs object = recycle
recycle:repository = .deleted
recycle:keeptree = Yes
recycle:touch = Yes
recycle:versions = Yes
recycle:maxsixe = 0
recycle:exclude = *.tmp
recycle:exclude_dir = /tmp

[Network Trash]
comment = Network Trashcan
path = /rd0/recycle
valid users = trash
writeable = yes
public = no

Now my next question is how do I change the timestamp on the files when they get moved into the "Trash" folder? I'd like to whip up a cron script to delete files after 5 days or so to keep the system sane.
Thanks.

jakev383 03-29-2007 08:05 AM

Didn't realize that the recycle:touch option was already modifying the mod time on the files - it's not visible unless you use "ls -lu" to see the mod date. That will make a cleaning script easier.
Hope this helps someone else out!


All times are GMT -5. The time now is 01:37 AM.