How To Install an FTP Server on an IpCop box

This step by step guide explains how to set up an ftp server (vsftpd) on an IpCop system
This has been tested on IpCop v.1.4.10 and with some mods may work on Smoothwall too.


I. Colors legend and some premises • Don't waste my time and take me to the first step

Colors used in this guide are organized as follow
Commands to be digited or done
- Text to be digited - Values and names - Links - considerations and suggestions - warnings

This guide assumes you to already have an IpCop 1.4.10 box up and running
This guide (optionally) assumes you to know how to use putty and WinSCP
This setup will not support Anonymous access
These are the vsftpd and IPCOP homepages
After your first successful ftp server test this vsftpd.conf guide will allow you to personalize your ftp server

II. (Optional) WinSCP and putty connecting the IpCop box

The following five steps are optional only if you are going to use the IpCop keyboard and monitor
Download putty and WinSCP
Enable the ssh on the IpCop box
Reboot the IpCop box
Connect to the IpCop with WinSCP (port is 222)
either if the port is the same 222 you can connect simultaneously the WinSCP and putty
Connect to the IpCop console with putty (port is 222)

1. Creating the login user and ftp root directory

Choose or create an ftp directory to be shared: i.e. /var/log/squid
I need to ftp access this dir only. I need ftp access for my logs reading issues: you can share another.
Create the following directory: mkdir /usr/share/empty
if you forget to create the above directory data ftp user won't access the FTP Server .
Add the data group: groupadd data

The following four steps can be optionally repeated for additional ftp users.
In that case, beware about the directory you are going to assign to the the new users.
I have not tested the additional users, I work with just one.

Add the username user: useradd -g data -d /var/log/squid -s /bin/false username (why false?)
Give the user username a password: passwd username
Set the /var/log/squid dir owner to root: chown root:root /var/log/squid
vsftpd requires that the ftp root directory is owned by the root user
Set the /var/log/squid dir as writable and executable by all users: chmod 777 /var/log/squid
remember this if one day you'll remove the username user

2. Download and install vsftpd

Download vsftpd packed for IpCop (::mirror:: - please don't use unless the other one is down)
Copy the vsftpdXXX.tar.gz file to the IPCop box - I usually copy it to /root/installers
Untar the archive: tar -xvzf vsftpd203.tar.gz
Change dir to untarred content directory: cd vsftpd*
Run installer from that dir: ./install -i

vsftpd will be installed in: /usr/sbin (it will be possible to run it from everywhere)

3. Editing /etc/vsftpd.conf

Ftp server needs a configuration file to allow access so:

• Empty /etc/vsftpd.conf using any editor, this mean: delete all its content
Insert the following lines into vsftpd.conf:
this configuration will disable the anonymous account

anonymous_enable=NO
check_shell=NO
local_enable=YES
write_enable=YES
local_umask=022
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
listen=Yes


the vsftpd.conf guide contents will allow you to personalize your ftp server

4. Editing /etc/rc.d/rc.sysinit to start vsftpd permanently

To start vsftpd each time IpCop boots:
edit /etc/rc.d/rc.sysinit file as follow
insert this text /usr/sbin/vsftpd & , it should be inserted beneath the line "/usr/local/bin/restartntpd",
Save the rc.sysinit and reboot IpCop.
Now the ftp server should be up and running.
Ftp connect to the IpCop box with user data and its password should pwd you to (in my example) /var/log/squid