Skip to content

pure-ftpd

Pure-FTPd is a free, open-source FTP (File Transfer Protocol) server software for Unix-like systems, written in C language. It provides secure, reliable, and efficient file transfers and is highly configurable, with features like virtual domains, bandwidth throttling, and anonymous access.

Instalation


sudo apt update
sudo apt install pure-ftpd

Connect


interactive shell

ftp $IP
|<- ftpuser
|<- ftpuser

Non-Interactive FTP Download (Windows)

echo open 10.11.0.5 21> ftp.txt
echo USER ftpuser>> ftp.txt
echo ftpuser>> ftp.txt
echo bin >> ftp.txt
echo GET nc.exe >> ftp.txt
echo bye >> ftp.txt
ftp -v -n -s:ftp.txt

Configuration


create new group

sudo groupadd ftpgroup
create new SYSTEM user
sudo useradd -g ftpgroup -d /dev/null -s /etc ftpuser
- -g ftpgroup: assigns the user to the "ftpgroup" group - -d /dev/null: sets the user's home directory to "/dev/null", which is a special file in Unix-like systems that discards all data written to it - -s /etc: sets the user's default shell to "/etc", which is usually not a valid shell and can be used to restrict the user's abilities add new ftp user
sudo pure-pw useradd ftpuser -u ftpuser -d /ftphome
- -u ftpuser: associates the FTP user with the SYSTEM user "ftpuser" - -d /ftphome: sets the FTP user's home directory to "/ftphome" create database for Pure-FTPd
sudo pure-pw mkdb
- This database is used to store the FTP users and their associated information, such as their username, password, home directory, etc create cymlink
cd /etc/pure-ftpd/auth/
sudo ln -s ../conf/PureDB 60pdb
- The "../conf/PureDB" file is the database created by the "pure-pw mkdb" command, and the "60pdb" symlink is used by the Pure-FTPd server to access the database. create home direcotry
sudo mkdir -p /ftphome
sudo chown -R ftpuser:ftpgroup /ftphome/
restart
sudo systemctl restart pure-ftpd