DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2007-10-16 05:34:55

Ethereal_Dragon
Member
From: USA
Registered: 2007-02-05
Posts: 55

Script to move files, or change permissions

No doubt, you have seen one of my other posts about FTP logging... well, I have a section of my DNS-323 set aside for Anonymous FTP... That part is located in the directory: /mnt/HD_a2/Anonymous FTP/

The (not sure what term to use.... Home I think??) directory for the anonymous users is setup as such:
dr-xr-xr-x    4 root     root         4096 Oct 14 17:04 Anonymous FTP

Located inside of that directory is the following....
dr-xr-xr-x   4 root root     4096 Oct 14  2007 .
dr-xr-xr-x   4 root root     4096 Oct 14  2007 ..
dr-xr-xr-x   2 root root     4096 Oct 15  2007 Download
-r--r--r--   1 root root      392 Oct 14  2007 Readme.txt
drwxrwxrwx   2 root root     4096 Oct 15  2007 Upload

I have run some tests with both FTP users, and anonymous users, and everything is working good, and I don't (think) that there will be a problem with  anyone getting access into somewhere they shouldn't.... I haven't set up the real user section (will be a different directory off of mnt/HD_a2, but I will climb that hurdle when I get there...)

Anyways, as you can see, I have given full access to the Upload folder. What I would like to do is have some kind of script or something to make it so that the files are either moved or the permissions are changed after a certain amount of time, to prevent other Anon users from deleting/renaming/over writing the files in the directory.

The more I think about it, the worse the 'move files' idea becomes... where do you move them to, and what if 2 files have the same name, what if one is malicios in some way.....

So, now I am thinking that perhaps I can use a scrpit to somehow execute "chmod -r a=o Upload" after a set amount of time, or (if there is a way) after a new file is put into the directory....

Is this idea feasible? Is there a better way to go about doing this?

EDIT: Also, is there a way to put a Quota on directory "/mnt/HD_a2/Anonymous FTP/Upload" without putting it on a specific user or group? /EDIT

Last edited by Ethereal_Dragon (2007-10-16 06:19:55)


Gaming Rig: ASUS Z87-PRO (V EDITION), Intel Core i5-4590 Haswell, HyperX FURY 8GB DDR3 1866,
XFX Radeon HD 4870, SILVERSTONE DA700, Samsung 840 500Gig SSD MZ-7TD500BW, 3x WD20EARS 2 TB Green,
ASUS DRW-2014L1T (DVD), LG WH14NS40 (Blu Ray), Dell 2709W, Sony SDM-HS95P, Windows 10 Pro
The NAS Box: D-Link DNS-323, 0.1RC3 Alt-F firmware, 2x 7200.14 ST3000DM001 3TB EXT4 - NO RAID - 6 TB

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB