Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a user who like to use the our Bitnami AWS ec2 instance to store podcasts. Up to this point they have been using http://www.lemonzdream.com/podcastmaker/ with MobileMe. Now that MM is dead, they just need some dedicated space to serve files from.

They aren't very tech savvy and setting up SFTP for them isn't ideal. I would like to give them a separate FTP account that will restrict access to a single web directory that they can upload to. The cloud image currently has a FTP server running but listening only in 127.0.0.1. The bitnami admin account is the only user.

Thoughts on how to do this?

share|improve this question
    
What is the difficulty in having them use sftp? There are many good FOSS clients, and it will probably be easier to setup, since you are already probably running an SSH server. –  Zoredache Jul 18 '12 at 21:18
    
They are using a podcast app not a sftp/ftp client. –  two7s_clash Jul 19 '12 at 22:17
add comment

1 Answer

up vote 1 down vote accepted

Install vsftpd

apt-get install vsftpd

First, be sure to open ports 35000:36000 on the firewall to permit PASV FTP.

Then for your /etc/vsftpd.conf

listen=YES
anonymous_enable=NO
local_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
hide_ids=YES
use_localtime=YES
nopriv_user=ftp
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd
guest_enable=YES
guest_username=ftp
user_config_dir=/etc/vsftpd_user_conf
ftpd_banner=My FTP Server
virtual_use_local_privs=YES
anon_upload_enable=NO
async_abor_enable=YES
pasv_min_port=35000
pasv_max_port=36000
pasv_enable=YES
port_enable=YES
write_enable=NO

Then to create a user, run,

/bin/htpasswd /etc/ftpd.passwd myusername

Then create the accompanying file in /etc/vsftpd_user_conf/myusername

guest_username=myuser
local_root=/home/myuser
write_enable=yes

The user connects as the guest_username stated, so it allows you to have multiple FTP users with different access, but all the while, preserving important file-level owner permissions.

That will give you a nice simple, chrooted, secure, isolated and manageable FTP configuration.

You're welcome.

share|improve this answer
    
Note that Bitnami users will need to install PAM, and that vsftpd is already installed. You will also need to comment #auth required pam_shells.so –  two7s_clash Jul 20 '12 at 0:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.