A secure FTP server and client implementation in Python featuring a custom TCP/IP stack, built-in file system with SQLite backend, and interactive command-line interfaces.
- Standard FTP command support (RFC 959)
- TLS/SSL encryption (FTPS)
- User authentication and access control
- File system permissions management
- Passive mode data transfers
- Compatible with FileZilla and other standard FTP clients
- SQLite-backed virtual file system
- File ownership management
- Access control
- Interactive file system CLI
- Interactive command-line client
- TLS/FTPS support
- Raw socket TCP implementation
- Connection establishment (3-way handshake)
- Keep-Alive
- TCP flags, sequence numbers, window sizing
USER
- Login usernamePASS
- Login passwordREIN
- Reinitialize sessionQUIT
- End session
RETR
- Download fileSTOR
- Upload fileDELE
- Delete fileRNFR
- Rename from (source)RNTO
- Rename to (destination)
LIST
- List filesMLSD
- Machine list directoryPWD
- Print working directoryCWD
- Change working directoryCDUP
- Change to parent directoryMKD
- Create directoryRMD
- Remove directory
TYPE
- Set transfer typeOPTS
- Set optionsFEAT
- Get featuresSYST
- Get system infoHELP
- Show helpNOOP
- No operation
AUTH TLS
- Initialize TLSPBSZ
- Protection buffer sizePROT
- Data channel protection level
login <user> <pass>
- Login to systemlogout
- Logout from systemls [path]
- List directory contentscd <path>
- Change directory
pwd
- Print working directory
mkdir
- Create directory
rmdir
- Remove directory
touch
- Create empty file
rm <file>
- Remove file
chmod
- Change permissions
rename
- Rename file/directory
# Linux
./deploy_server.sh
# Windows
.\deploy_server.ps1
Or manually:
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
pip install -r requirements.txt
python start_server.py
python src/ftp_client/start_client.py
python file_system_cli.py -i
Server settings in server_config.json
{
"ftp_host": "127.0.0.1",
"ftp_port": 229,
"use_custom_transport": false,
"support_FTPS": true
}