Solved

Best FTP program to accomplish this setup

Posted on 2006-11-22
6
192 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

912 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

17 Experts available now in Live!

Get 1:1 Help Now