Wednesday, June 22, 2011

Install vsftp di Centos VPS

1. Langkah pertama Instalasi Paket vsftpd
[root@voip-client ~]# yum install vsftpd
2. Lalu Konfigurasi
[root@voip-client ~]# vim /etc/vsftpd/vsftpd.conf
Yang perlu dirubah adalah:
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to FTP Server K-Place.
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
3. Kemudian buat user lokal dengan nama noc
[root@voip-client ~]# adduser noc
[root@voip-client ~]# passwd noc
Changing password for user noc.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
4. Membuat file chroot_list
File ini berisi daftar user yang bisa mengakses FTP server.
[root@voip-client ~]# vim /etc/vsftpd/chroot_list
Isinya adalah :
noc
5. Restart Service FTP
[root@voip-client ~]# service vsftpd restart
[root@voip-client ~]# chkconfig vsftpd on

You use OpenSSL to generate a certificate for vsftpd. The certificate is store on your server, in a location of your choice. Here I choose to put it in the /etc/vsftpd directory. As well, you specify a 'lifetime' for the certificate; here's it set for a year ("-days 365").
Note that the backslashes only signify line breaks. You should be able to copy/paste & run it as it is, or remove the backslashes and the line breaks. You may need to create this directory first (mkdir /etc/vsftpd).
[root@vps] openssl req -x509 -nodes -days 365 -newkey rsa:1024 \
 -keyout /etc/vsftpd/vsftpd.pem \
 -out /etc/vsftpd/vsftpd.pem
You will be prompted with a series of question, which you answer as they appear. When done the certificate will be installed in the /etc/vsftpd directory.

Configure vsftpd

To configure vsftpd you edit the file /etc/vsftpd/vsftpd.conf and add the following lines:
ssl_enable=YES
 allow_anon_ssl=NO
 force_local_data_ssl=NO
 force_local_logins_ssl=NO
 ssl_tlsv1=YES
 ssl_sslv2=NO
 ssl_sslv3=NO
 rsa_cert_file=/etc/vsftpd/vsftpd.pem
Restart vsftpd for these settings to take effect:
[root@vps] /etc/rc.d/init.d/vsftpd restart


Artikel lain:

How to install VSFTP in CentOS

Check whether you have installed vsftpd installed or not by using following command.
[root@localhost ~]# yum list installed | grep ftp
If you find vsftpd in the output, then ftp server installed in CentOS.
1. Command to install VSFTP
# yum install vsftpd
2. Add VSFTPD service in chkconfig (current run level)
# chkconfig vsftpd on
3. Start the FTP service
# service vsftpd start
4. After starting the vsftpd service try connecting ftp locally
# ftp localhost

No comments:

Post a Comment