FTP Server - Setup and Usage (VSFTPD)
FTP Server - Setup and Usage (VSFTPD)
Introduction to FTP
FTP (File Transfer Protocol) is a standard network protocol used for transferring files
between a client and a server over the internet or a local network. It is built on a client-server
architecture and operates on ports 20 and 21. FTP servers facilitate data sharing, remote
storage, and file management.
In this guide, we will delve into FTP server setup, client interaction, commands, and outputs,
ensuring clarity in every step.
https://blog.geekinstitute.org/2024/11/ftp-server-s.html 1/8
2/6/25, 2:53 PM FTP Server : Setup and Usage (VSFTPd)
There are many FTP server applications available. Common ones include:
2. Install vsftpd
3. Configure vsftpd
https://blog.geekinstitute.org/2024/11/ftp-server-s.html 2/8
2/6/25, 2:53 PM FTP Server : Setup and Usage (VSFTPd)
local_enable=YES
write_enable=YES
chroot_local_user=YES
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
4. Add Users
5. Restart vsftpd
https://blog.geekinstitute.org/2024/11/ftp-server-s.html 3/8
2/6/25, 2:53 PM FTP Server : Setup and Usage (VSFTPd)
FileZilla
Cyberduck
Command-line FTP clients
2. Command-Line Connection
ftp <server-ip-address>
Example:
ftp 192.168.1.100
Connected to 192.168.1.100.
220 (vsFTPd 3.0.3)
Name (192.168.1.100:username): ftpuser
331 Please specify the password.
https://blog.geekinstitute.org/2024/11/ftp-server-s.html 4/8
2/6/25, 2:53 PM FTP Server : Setup and Usage (VSFTPd)
Password:
230 Login successful.
Active Mode: The client opens a random port, and the server connects back to it.
Passive Mode: The server provides a port for the client to connect. Use this mode if
firewalls block the active connection.
pasv_enable=YES
pasv_min_port=40000
pasv_max_port=50000
1. Navigational Commands
1. pwd (Print Working Directory): Displays the current directory on the FTP server.
ftp> pwd
257 "/home/ftpuser" is the current directory.
ftp> ls
200 PORT command successful.
150 Here comes the directory listing.
file1.txt
https://blog.geekinstitute.org/2024/11/ftp-server-s.html 5/8
2/6/25, 2:53 PM FTP Server : Setup and Usage (VSFTPd)
file2.txt
226 Directory send okay.
ftp> cd documents
250 Directory successfully changed.
https://blog.geekinstitute.org/2024/11/ftp-server-s.html 6/8
2/6/25, 2:53 PM FTP Server : Setup and Usage (VSFTPd)
150 Ok to send data.
226 Transfer complete.
3. Miscellaneous Commands
ftp> bye
221 Goodbye.
1. Enable SSL/TLS: Install an SSL certificate and configure vsftpd to use FTPS (FTP Secure):
ssl_enable=YES
rsa_cert_file=/etc/ssl/certs/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.key
anonymous_enable=NO
xferlog_enable=YES
log_ftp_protocol=YES
xferlog_file=/var/log/vsftpd.log
4. Use a Firewall: Configure your firewall to allow only necessary FTP ports.
Conclusion
FTP servers are invaluable for file sharing and storage but require proper setup and security
measures. By following this guide, you can set up a robust FTP server, understand key FTP
commands, and manage file transfers efficiently. Always prioritize security by using FTPS and
monitoring server activity regularly.
https://blog.geekinstitute.org/2024/11/ftp-server-s.html 8/8