RSS
 

Archive for the ‘ftp’ Category

Setting up VSFTPD

29 Mar

The virtual machine I used was a centos 5 linux distribution, I then installed VSFTP

1. Install VSFTPD

[root@localhost]# yum install vsftpd

2. Make sure vsftpd starts on bootup

[root@localhost]# chkconfig vsftpd on

3. Switch of anonymous ftp access

[root@localhost]# vi /etc/vsftpd/vsftpd.conf

then change the line to

anonymous_enable=no

4. You can change the greeting you see when you connect to the ftp server by changing the line

tpd_banner= New Banner Here

5. Create a user group and shared directory. In this case, use /var/www/vhosts and a user group name of ftp-users for the remote users

[root@localhost]# groupadd ftp-users
[root@localhost]# mkdir /var/www/vhosts

6. Make the directory accessible to the ftp-users group.

[root@localhost]# chmod 775 /var/www/vhosts
[root@localhost]# chmod 775 /var/www

7. Add users, and make their default directory /var/www/vhosts

[root@localhost]# useradd -g ftp-users -d /var/www/vhosts user1

8. Change the permissions of the files in the /var/www/vhosts directory for read/write only access by the group

[root@localhost]# chown root:ftp-users /var/www/vhosts*

9. Restart the VSFTPD service using

[root@localhost]# service vsftpd restart

10. Make sure you are not blocking ftp ports to the server (ftp requires port 21 to be open)

system-config-securitylevel

11. After configuring the vsftpd server on an Amazon ec2 server , I was not able to connect to vsftpd in one server from my ftp client. It throws the error:

500 OOPS: vsf_sysutil_recv_peek

The solution for this problem is to load capability module:

# modprobe capability

12. If you are having trouble connecting with an FTP client (such as FileZilla) and receiving an error like below

Error: Could not read from socket: ECONNRESET – Connection reset by peer
Error: Disconnected from server
Error: Failed to retrieve directory listing

Then make sure you change the connection settings in the client to ‘active’ rather than ‘default’