[BlueOnyx:10881] Re: FTP default folder

Colin Jack colin at mainline.co.uk
Tue Jun 26 13:20:32 PET 2012


Hi Chuck,

On 26 Jun 2012, at 16:39, Chuck Tetlow wrote:

> Well, if you trust them - its actually a easy thing to do. 
> 
> Go to the /etc directory and look at the "passwd" file.  This is a list of the users configured on the server.  Open it to edit with VI or your favorite editor.  Find the username you want to set their FTP directory.  You'll find it looks something like this: 
> 
> jdoe:x:584:512:John Doe:/home/.sites/90/site11/.users/97/jdoe:/bin/badsh 
> 
> The fields are 1)Username 2)Password  3)UserID 4)GroupID 5)Comment field 6)Home directory 7)Command shell 
> 
> The password will always be "x" because the password is stored elsewhere in hashed format. 
> The comment field in the BX is used to store the user's full name entered when creating the account 
> 
> And you're looking for the "Home directory" field.  It will be set to that user's home directory.  Change that field to point to the directory you want them dropped into when they FTP in - something like /home/.sites/90/site11/web (the website directory for that site/domain).  Then simply save.  
> 
> Now each time that user FTPs in - he'll be dropped right into that directory.  Mind you - it has to be part of the same site of which he's a user (not a different site where he doesn't have privileges). 
> 
> Test afterward with that user's login to make sure it works.  You'll find that works every time.  But you've got to have shell access to the server and know how to edit that text file at the command line.  
> 
> OH!  And you might want to make a copy of that /etc/passwd file somewhere else before starting.  That way, if you screw up the editing - you haven't bombed your whole server!! 

That is exactly what I was looking for!

Much appreciated.

Colin





More information about the Blueonyx mailing list