Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Best FTP program to accomplish this setup

Posted on 2006-11-22
6
Medium Priority
?
200 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

971 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