โ† Back to list

๐Ÿ“ FTP Server Setup & Configuration on Linux (Complete Guide)

Install, Configure, Secure & Understand FTP (Active vs Passive) in Real-World Linux Environments ย Linux Administration | Networking | Fileโ€ฆ

DevOps voice in Write A Catalyst ยท 2025-12-22 17:29 ยท 55 claps ยท 2.8 min read paywalled
#ftp-server #ftp-client #linux #linux-administration #devops
Open on Medium โ†—
Wiki topics: โ˜๏ธ ยท DevOps & Cloud ๐Ÿ”“ ยท Open Source

Image by author

Image by author

๐Ÿ“ FTP Server Setup & Configuration on Linux (Complete Guide)

*Install, Configure, Secure & Understand FTP (Active vs Passive) in Real-World Linux Environments

  • Linux Administration | Networking | File Transfer

**Non-member= Click!**

๐Ÿ” What Is FTP?

FTP (File Transfer Protocol) is a standard network protocol used to transfer files between a client and a server over TCP.

  • Default Ports
  • Control channel: 21
  • Data channel: 20 (Active FTP) or High ports (Passive FTP)

๐ŸŽฏ What Problem Does FTP Solve?

FTP is used when:

  • Files need to be shared between systems
  • Large data transfers are required
  • Applications upload/download data
  • Centralized file repositories are needed

Common real-world use cases:

  • Application log sharing
  • Media & backup transfers
  • Internal file sharing
  • Legacy system integrations

๐Ÿ”„ FTP vs NFS vs Filesystem

๐Ÿง  FTP Applications

Linux FTP Servers

  • WUFTP
  • VSFTPD โœ… (Very Secure FTP Daemonโ€”recommended)
  • SFTP (over SSHโ€”most secure)
  • ProFTPD

Windows FTP Servers

  • IIS FTP Server
  • FileZilla Server

๐Ÿ› ๏ธ Installing VSFTPD on Linux

yum install vsftpd -y

FTP Root Directories

/var/ftp        # FTP root
/var/ftp/pub    # Public directory

๐Ÿ”Ž Verify VSFTPD Installation

rpm -qa | grep -i vsftpd
rpm -qi vsftpd
rpm -ql vsftpd

Important Files

โ–ถ๏ธ Start & Enable FTP Service

/etc/init.d/vsftpd restart
chkconfig vsftpd on

๐Ÿ’ก Starting a service means loading the binary into RAM

๐Ÿ‘ฅ FTP User Types

  1. Anonymous User โ€” No username/password
  2. Local User (VLU) โ€” Linux system users
  3. Virtual User โ€” App-specific FTP users

๐Ÿ” Securing FTP (Disable Anonymous Access)

Backup Config

cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.default

Edit Configuration

vi /etc/vsftpd/vsftpd.conf

Recommended Secure Settings

anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
local_umask=022
xferlog_enable=YES
xferlog_file=/var/log/xferlog
listen=YES
userlist_enable=YES
tcp_wrappers=YES

Restart service after changes:

systemctl restart vsftpd

๐Ÿšซ Block FTP Users

vi /etc/vsftpd/ftpusers
vi /etc/vsftpd/user_list

Add usernames to deny access.

๐ŸŒ TCP vs UDP (Networking Basics)

๐Ÿ” Check FTP Port Status

netstat -anp | grep 21
lsof -i :21
nmap -sT localhost

๐Ÿ” Active vs Passive FTP (Interview Favorite)

๐Ÿ”ด Active FTP

  • Client โ†’ Server (21)
  • Server โ†’ Client (20 โ†’ high port)
  • โŒ Fails behind NAT/firewalls

๐ŸŸข Passive FTP (Default in Linux)

  • The clientClient initiates all connections
  • Firewall-friendly
  • โœ… Recommended

๐Ÿ“ฅ FTP Client Tools

GUI

  • FileZilla (Windows/Linux)
  • gFTP
  • Kasablanca

CLI

ftp <server-ip>
lftp <server-ip>

Common FTP Commands

mget file     # download
mput file     # upload
ls
cd
help

๐Ÿ“‚ Anonymous vs Regular FTP

๐Ÿ”ฅ FTP & Firewall Issues (Real-World)

FTP often breaks due to:

  • Dynamic ports
  • NAT restrictions
  • Active FTP callbacks

โœ… Solution

  • Use Passive FTP
  • Allow port ranges in the firewall.
  • Prefer SFTP for production

VSFTPD is a stable, secure, and widely used FTP server for Linux. Understanding:

  • Active vs Passive FTP
  • User types
  • Chroot & permissions
  • Ports & firewalls

โ€ฆis critical for Linux admins, DevOps engineers, and network engineers.

Thank you..! ๐Ÿ˜Š

๐Ÿ‘ If you found this article helpful, click the clap button and drop a comment. ๐Ÿ˜Š Follow for more DevOps, Linux & Cloud tutorials.


๋ฉ”ํƒ€๋ฐ์ดํ„ฐ
post_id
e24328db41db
slug
ftp-server-setup-configuration-on-linux-complete-guide-e24328db41db
url
https://medium.com/write-a-catalyst/ftp-server-setup-configuration-on-linux-complete-guide-e24328db41db
canonical_url
https://medium.com/write-a-catalyst/ftp-server-setup-configuration-on-linux-complete-guide-e24328db41db
author_url
https://medium.com/@tushar.jadhav29
status
ok
fetched_at
2026-08-31 09:08:38