VSFTPD merupakan aplikasi atau daemon server FTP. Konfigurasi untuk VSFTPD ini juga relatif mudah. Berikut ini akan saya jelaskan konfigurasi untuk VSFTPD:

1. Edit file vsftpd.conf
[root@maulana]# vim /etc/vsftpd/vsftpd.conf

2. Periksa file vsftpd.conf sesuai konfigurasi dibawah ini:
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
idle_session_timeout=600
data_connection_timeout=120
nopriv_user=ftp
ftpd_banner=WELCOME TO FTP SERVER.
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
# Yang dapat diakses oleh client ke FTP Server
#ALLOWED FOR ALL
cmds_allowed=CDUP,CWD,RNFR,RNTO,PORT,MKD,RMD,DELE,STOR, GET,PUT,PASV,FEAT,RETR,PWD,LIST,TYPE,LS,ASCII,BIN,HASH

##################
# COMMAND CMDS
##################

###########################################
# 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
###########################################

3. Buat file chroot_list
[root@maulana]# touch /etc/vsftpd/chroot_list

4. Restart vsftpd
[root@maulana]# service vsftpd restart

5. Buat grup user dan direktori file FTP
[root@maulana]# groupadd ftp-users
[root@maulana]# mkdir /home/ftp-docs

6. Buat direktori yang akan di akses grup ftp-users
[root@maulana]# chmod 777 /home/ftp-docs
[root@maulana]# chown root:ftp-users /home/ftp-docs

7. Tambah user dan buat direktori default untuk /home/ftp-docs
[root@maulana]# useradd -g ftp-users -d /home/ftp-docs user1
[root@maulana]# useradd -g ftp-users -d /home/ftp-docs user2
[root@maulana]# useradd -g ftp-users -d /home/ftp-docs user3
[root@maulana]# useradd -g ftp-users -d /home/ftp-docs user4
[root@maulana]# passwd user1
[root@maulana]# passwd user2
[root@maulana]# passwd user3
[root@maulana]# passwd user4

8. Copy files yang akan di download oleh user pada /home/ftp-docs
9. Ubah hak akses untuk files pada direktori /home/ftp-docs
[root@maulana]# chown root:ftp-users /home/ftp-docs/*
[root@maulana]# chmod 777 /home/ftp-docs/*

10. Periksa hak akses jaringan linux:
[root@maulana]# getsebool -a | grep ftp
[root@maulana]# setsebool -P ftp_home_dir on
[root@maulana]# getsebool -a | grep ftp

Selamat mencoba.  

Share