We implemented a server that is running the FTP protocol over TLSv3 Sockets in the programming language C. This implementation is based on the following paper:
RFC 959 - File Transfer Protocol (FTP).
- In order for the server to run, a certificate and a key must be provided.
Those must be added inside the folder named
certificatesand named:
- Certificate :
server-cert.pem- Key :
server-key.pem
-
We provided a shell script that will generate a self-signed certificate with a private key. The shell script is located in the
certificatesfolder and is calledgenerate_certificate.sh -
We provide a default configuration file named
config.confthat will be used by the server. The configuration file is located in theconfigfolder and is calledconfig.conf -
In case you want to change the configuration file, you can do it by editing the file inside the
configfolder.
The configuration file is a simple text file that contains the following parameters:
NUM_THREADS: The number of threads that will be used by the server.MAX_CONNECTIONS: The maximum number of connections that the server will accept.IP: The IP address that the server will listen to.PORT: The port that the server will listen to.REUSE_SOCKET: If set to1, the server will reuse the socket.HOME_DIR: The home directory of the server.CERT_FILE: The certificate file that will be used by the server.KEY_FILE: The key file that will be used by the server.
- Compile code using:
makeormake all. - Run code using:
./serveror./server -default
- Mode A: Run using:
./server: The server will use the values defined in theconfig.conffile. In case the file does not exist, the program will exit.Default values are:
NUM_THREADS=8# Number of threads running in the thread poolMAX_CONNECTIONS=16# Maximum number of connections the server can handleIP=127.0.0.1# IP address of the serverPORT=30000# Port the server will listen onREUSE_SOCKET=0# If set to 1, the server will reuse the socketHOME_DIR=./ftphome# The home directory of the serverCERT_FILE=./certificates/server-cert.pem# The server's certificateKEY_FILE=./certificates/server-key.pem# The server's private key
- Mode B: Run using:
./server -default: The server will use default values predefined incommon.h
- USER
<username> - PASS
<password> - SYST
<system> - FEAT
<features> - PBSZ
<size> - PROT
<protection> - PWD
<path> - TYPE
<type> - CWD
<path> - LIST
<path> - RETR
<path> - STOR
<path> - MKD
<path> - DELE
<path>