Install and Configure VSFTPD Server in RHEL7

Install vsftpd
# yum install vsftpd

Start vsftpd service
# systemctl start vsftpd.service

Make FTP service startup persistent on system boot
# systemctl enable vsftpd.service

Check whether port 21 is open
# netstat -tanp | grep LISTEN | grep vsftpd

Open firewall port
# firewall-cmd --permanent --zone=public --add-port=21/tcp
# firewall-cmd --permanent --zone=public --add-service=ftp
# firewall-cmd --reload

Configure vsftpd
# vim /etc/vsftpd/vsftpd.conf

1
2
3
4
5
6
7
8
anonymous_enable=NO
local_enable=YES
write_enable=YES
userlist_enable=YES
userlist_deny=YES
userlist_file=/etc/vsftpd/user_list
local_root=$HOME
cmds_allowed=ABOR,CWD,LIST,PASS,PORT,PASV,PWD,QUIT,STOR,TYPE,USER,ACCT*,HELP,MODE,REIN*,STAT,STOU,STRU,SYST,MKD

Restart vsftpd service
# systemctl restart vsftpd.service

Check vsftpd service status
# systemctl status vsftpd.service

FTP command table

ABOR : abort a file transfer
CWD : change working directory
DELE : delete a remote file
LIST : list remote files
MDTM : return the modification time of a file
MKD : make a remote directory
NLST : name list of remote directory
PASS : send password
PASV : enter passive mode
PORT : open a data port
PWD : print working directory
QUIT : terminate the connection
RETR : retrieve a remote file
RMD : remove a remote directory
RNFR : rename from
RNTO : rename to
SITE : site-specific commands
SIZE : return the size of a file
STOR : store a file on the remote host
TYPE : set transfer type
USER : send username
less common commands:
ACCT* : send account information
APPE : append to a remote file
CDUP : CWD to the parent of the current directory
HELP : return help on using the server
MODE : set transfer mode
NOOP : do nothing
REIN* : reinitialize the connection
STAT : return server status
STOU : store a file uniquely
STRU : set file transfer structure
SYST : return system type