Installasi FTP Server Linux

Di Linux, aplikasi FTP biasa menggunakan VSFTPD (very secure FTP daemon). Jika saat instalasi Linux (di sini saya menggunakan CentOS) tidak diinstall aplikasi macam-macam, biasanya ftp belum ada paketnya. Untuk itu kita perlu menginstallnya.

Sebelum melakukan instalasi ftp, ada baiknya membaca beberapa panduan di internet seperti [1], [2].

Step 1: cek keberadaan package.

[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
[root@localhost ~]#

[root@localhost ~]# rpm -q vsftpd

package vsftpd is not installed

[root@localhost ~]#

Jika sudah terinstall maka akan terlihat telah diinstall.

[root@localhost ~]# rpm -q vsftpd ftp
vsftpd-2.2.2-13.el6_6.1.i686
ftp-0.17-54.el6.i686
[root@localhost ~]#

Step 2: Install package VSFTPD

[root@localhost ~]#yum install -y vsftpd ftp

Step 3: Reconfigurasi file vsftpd.conf

[root@localhost ~]#cd /etc/vsftpd

[root@localhost vsftpd]# ls -ltr
total 28
-rwxr–r–. 1 root root  338 Oct 17  2014 vsftpd_conf_migrate.sh
-rw——-. 1 root root  361 Oct 17  2014 user_list
-rw——-. 1 root root  125 Oct 17  2014 ftpusers
-rw——-. 1 root root 4642 Jul 28 06:16 vsftpd.conf.bak
rw——-. 1 root root 4658 Jul 28 06:31 vsftpd.conf
[root@localhost vsftpd]#vi vsftpd.conf

lalu edit beberapa baris di bawah:

anonymous_enable=NO

local_enable=YES

ftpd_banner=Welcome to FTP Server KOMAR.

lalu save dan exit (tekan ESC :wq).

Step 4: Restart service

[root@localhost vsftpd]# chkconfig vsftpd on

[root@localhost vsftpd]# service vsftpd restart

Step 5: test dan verify

[root@localhost vsftpd]# ftp 192.168.254.130
Connected to 192.168.254.130 (192.168.254.130).
220 Welcome to FTP Server KOMAR.
Name (192.168.254.130:root): phino
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/home/phino
Login failed.
ftp> who

Jika ada error seperti di atas, kita set SELINUXnya.

[root@localhost vsftpd]# setsebool -P ftp_home_dir on

[root@localhost vsftpd]# ftp 192.168.254.130
Connected to 192.168.254.130 (192.168.254.130).
220 Welcome to FTP Server KOMAR.
Name (192.168.254.130:root): phino
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (192,168,254,130,33,103).
150 Here comes the directory listing.
-rw-r–r–    1 501      501         18672 Jul 28 06:32 25rb.pdf
226 Directory send OK.
ftp>

Step 6: Lakukan pengetesan dari ftp client seperti FileZilla dsb dengan meng-upload file atau download file.

Selamat mencoba.

Referensi:

[1] https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-ftp-vsftpd-conf.html

[2] https://ostechnix.wordpress.com/2013/12/15/setup-ftp-server-step-by-step-in-centos-6-x-rhel-6-x-scientific-linux-6-x/

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s