Solved

Best FTP program to accomplish this setup

Posted on 2006-11-22
6
191 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 39

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
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 …
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now