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 virtual server running CentOS, and need to create an FTP user to give to a client so they can upload some files to me.

Any idea how I go about this, and how I only give them access to upload from one folder? (I don't care what folder, as long as they do not get access to my other files.)

Thanks.

share|improve this question
add comment

2 Answers

Consider setting up an SFTP server with OpenSSH and a chrooted home directory for your user(s). Benefits: key pair authentication (so you can disable password authentication), you don't need (or they don't need) to open any additional ports beyond TCP 22, end-to-end encryption, and with a chrooted home directory, they're "jailed" within their chrooted home directory only and have no access outside of that directory.

share|improve this answer
add comment

Here are the basics

Create a local user account for your client give it a password and home directory etc.

Install vsftpd

yum install vsftpd

Edit

/etc/vsftpd/vsftpd.conf

anonymous_enable=NO
local_enable=YES
write_enable=YES
xferlog_file=YES
local_umask=022
chroot_local_user=YES
listen=YES
pam_service_name=vsftpd

save the file and exit then restart vsftpd

/sbin/service vsftpd restart

and ensure it runs when the system starts

/sbin/chkconfig vsftpd on

Edit /etc/sysconfig/iptables-config

ensure that there is an entry for IPTABLES_MODULES which amongst other things contains ip_conntrack_ftp e.g.

IPTABLES_MODULES="ip_conntrack_ftp"

Then modify the firewall

/sbin/service iptables save

edit /etc/sysconfig/iptables

After the line

:RH-Firewall-1-Input - [0:0] or similar ( the [0:0] may be different) add

-A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 21 -j ACCEPT

save the file and exit then restart the firewall

/sbin/service iptables restart

You sould be good to go.

share|improve this answer
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.