Solved

Best FTP program to accomplish this setup

Posted on 2006-11-22
6
194 Views
Last Modified: 2013-12-15
I would like to have multiple users who after they login, get dumped into their  own folder...
For example.../Ftp would be the main directory and within in that we would have
/FTP/userA
/FTP/UserB

The user couldnt go higher up then their directory.  I didnt see this configuration possible with VSFTPD
Any Ideas?

0
Comment
Question by:akalbfell
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:noci
ID: 18001810
run the ftp daemon in a chroot jail and then
let it have it's own /etc/passwd file with it's own paths.
(ie the HOME of a user in the FTP jail is /FTP/userA for userA.)

0
 
LVL 14

Expert Comment

by:ygoutham
ID: 18003692
add this line to the vsftpd.conf

chroot_local_user=YES

restart vsftpd
that would put them in a chrooted jail.
0
 
LVL 8

Author Comment

by:akalbfell
ID: 18005755
ygoutham, what would determine what folder is that "jail"
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 8

Author Comment

by:akalbfell
ID: 18005882
because what im trying to accomplish is having multiple hosted websites on one box. the websites are setup like this..

/var/html/website1
/var/html/website2
/var/html/website3

if a person ftp's into ftp://website1.com it should bring them into the above directory. If another person ftp's into ftp://website2.com it would bring them into their home directory.
Since all names point to the same address, the username will determine which folder to drop them into.
0
 
LVL 14

Accepted Solution

by:
ygoutham earned 500 total points
ID: 18017268
the jail is the home folder specified for each user in the /etc/passwd file for every user.  you can always add users with a

useradd -d /some/home/folder someuser
passwd someuser

this puts the entry for the "someuser" as /some/home/folder for the specified user in /etc/passwd file

i would suggest adding a ftpuser account

groupadd someftpgroup

useradd -d /some/home/folder -g someftpgroup someuser
useradd -d /some/other/home -g someftpgroup someotheruser

now all the users created belong to a primary group "someftpgroup".  change ownership of all the folders in

/var/html

with the following

chgrp -R someftpgroup /var/html
chmod -R 775 /var/html

this ways all the users can do a ftp and upload and write into their home folder.  take a look at the "local_umask" in vsftpd.conf and change it accordingly to make all files uploaded to have 775 as the default permission so that the files may also be usable through the web browser. otherwise httpd which runs as "apache" user by default might not have read permissions and the pages might not be displayed.

but if you want to have different home directories than the html folders, then create symbolic links in the /var/html directory and the webpages might still be served...
0
 
LVL 8

Author Comment

by:akalbfell
ID: 18017322
Thanks, exactly the info i was looking for.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question