PDA

View Full Version : [Filled] Scripts to create new dir for new user


hUn7eR
02-24-2004, 09:14 PM
maybe there exists such a script but I search the web for a long time and can't find it.
I have a ftp that have many users,each of them has there own private dirctory(as their name).I hope the directory will be auto creat when I add the user to the group.

Sample,there's a group test,then I want to add test1 to test100
they need a private dir like d:\test\test1,d:\test\test2....to d:\test\test100,everyuser login and will be locked in their own dir.

can anyone help me?it bother me so much.

Mouton
02-25-2004, 09:40 AM
How do you want to add those users ?
With what command (exact command) ?

To be locked in their personnal dir, they need a different VFS. Each of them.
Or maybe if the dirs are 700, they could see other's dirs but they couldn't enter them...

ADDiCT
02-25-2004, 09:48 AM
what about hiding the other dirs by "chattr +h"-ing all dirs to their only 'owner'

post-'site adduser'-event
-> mkdir username
-> chattr +h username "-username"

something like that

Mouton
02-25-2004, 09:58 AM
Now that i think about it, a simple FFXP command would do...

SITE GADUSER %d[Group:] %d[User:] %d[Password:] %d[Ident@IP:]
MKD /home/%2
SITE CHATTR +h /home/%2 "1M -%2"
SITE CHANGE %2 homedir /%2
SITE CHANGE %2 vfsfile ..\etc\users.vfs

And users.vfs would look like:
"D:\ioFTPD\site\home" /

Note: the SITE CHATTR line gives access to the user dir to himself and 1 and M users (siteops, Masters).

hUn7eR
02-25-2004, 10:11 AM
creating a script for adding user and change the vfs of every user is OK,thx for the ideas from Mouton,I think I can write one with ultrafxp instead.


I wonder if there's a script can auto write the vfs file.Creating each vfs file and upload is a nightmare.
Each user should not see anything beside their dir.If ioftpd support -list access then it will be easy lol.

ADDiCT
02-25-2004, 10:57 AM
the way mentioned above doesn't require a separate vfs file for each user

hUn7eR
02-26-2004, 03:11 AM
thx,let me try.

I have an idea that if the ioftpd's vfs file support %u then everything is ok,all the users can share one vfs file
d:\ftproot\%u(may be I remember the wrong variable)

Mouton
02-26-2004, 10:14 AM
vfs files doesn't support any kind of variables.
was never suggested, and i never heard dark mention plans about that. if you want that, maybe post a thread in suggestions forum.