Help - Search - Members - Calendar
Full Version: Proftpd User Home Dir
Linuxhelp > Support > Technical Support
heyas these forums are awesome, been reading since before i was brave enuff to get a box up.
Now i have a box up:) running debian (not sure what ver, just d/l last week).

ive done an apt-get install proftpd and it all is working fine so far.. just would like to know how i can change the default directory for ftp to be /var/www for uploading pages and so forth.

Im stupidly new to linux... also.. im not sure what sort of persmissions i should set for that dir... assuming that im the only one that will upload, and of course assuming that other ppl mite want to be malicious. smile.gif
any thoughts?
How you can tell what distro of Debian you have is by looking in your /etc/apt/sources.list file ...

If it is pointing to a stable only, you are using Woody ...
If it is pointing to testing (maybe with stable for security updates only), you are using Sarge ...
If it is pointing to unstable, you are using SID ...

At the bottom of the file /etc/proftpd.conf (make sure you have all the anonymous stuff remarked out with a # right now) ... add this line:

DefaultRoot /var/www/ your_user

personally, I would make the owner of the /var/www directory my main user (in my case johnny) and the group www-data with this command:

chown -R johnny:www-data /var/www

I would make the permissions 775 on the www directory and 755 on all subdirectories under www ... except I would have any directories where the apache user (www-data) needs to write 775 as well.

I would make the permissions of most files (except ones that need to be written to by the webserver) 744 and the ones that ahve to be written to by the webserver at 774.
I would put all other FTP users in a chroot jail ... I would create an FTP directory (I use /var/ftp) and an ftp group (ftp) ...

groupadd ftp

mkdir /var/ftp
chown -R root:ftp /var/ftp
chmod -R 775 /var/ftp

Now add this line after the DefaultRoot /var/www/ your_user line:

DefaultRoot /var/ftp

All users (except ones you call out above the DefaultRoot /var/ftp line) who login will be stuck in the /var/ftp directory ... if you want a user to be able to write in the /var/ftp directory, make them members of hte ftp group ... others can't all others write.

If you want to have other users who default into the another directory, add a line above the DefaultRoot /var/ftp line that is DefaultRoot /directory_path user
ahhh k... seems im running woody..

now i had already "chown"ed the /var/www although i didnt really know what i was doing.. what is the advantage of having the group there as well?

chown -R johnny:www-data /var/www

everything else seems str8 forward enough.... after being shown, that is tongue.gif
thanx heaps, that will me out alot.

Obviously you want to substitute your user for johnny.

The purpose for the group is that you can assign other users to be members of that group ... then they can change things in that directory...which could be good in the future. If you don't want anyone else to change the directory, you would not make them members of the www-data group.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.