មេរៀនទី១១: ដំឡើងនិងរៀបចំ Vsftpd

មេរៀនទី១១: ដំឡើងនិងរៀបចំ Vsftpd លើ Linux

វិធីដំឡើងនិងបង្កើត (Install & Configure)​ Vsftpd Ftp Server សំរាប់ប្រពន្ធ័ RHEL 6/ CentOS 6.2 Ubuntu 11.10/ Fedora /Debian ។ VSftpd (Very Secure FTP Daemon) គឺជា FTP Server ដែល សំរាប់ ដំណើរការ នៅលើ ប្រពន្ធ័ Linux ។​ វាមិនត្រិមតែមាន Security ខ្ពស់ប៉ុណ្ណោះទេ​ VSftpd អាចដំណើរការបានយ៉ាងរហស័ ដោយប្រើប្រាស់ Memory តិចបំផុត។ ជាសង្ខេប ខ្ញុំបង្ហាញ របៀបដំឡើងនិងបង្កើត (Install & Configure) Vsftpd service ដូចជាបង្កើត ftp users និងបែងចែក user directory និមួយៗ នៅលើ Red Hat Enterprise Linux 6 (RHEL 6), Ubuntu, CentOS និង Fedora ។
aa

Default ftp port : 21
Default configuration file : /etc/vsftpd.conf
Basic Vsftpd commands on RHEL/CentOS/Fedora
1. Install the Vsftpd service.

root@rhel6 ~]# yum install vsftpd

2. Start Vsftpd Service :

root@rhel6 ~]# service vsftpd start

3. Stop Vsftpd Service :

root@rhel6 ~]# service vsftpd stop

4. Restart Vsftpd Service :

root@rhel6 ~]# service vsftpd restart

5. Make Vsftpd Service auto start on boot up :

root@rhel6 ~]# chkconfig vsftpd on

6. Edit the vsftp.conf

root@rhel6 ~]# vi /etc/vsftpd/vsftpd.conf

Basic Vsftpd Commands on Ubuntu/ Debian
1. Install the Vsftpd service on Ubuntu.

root@ubuntu ~]# sudo apt-get install vsftpd

2. Start Vsftpd Service :

root@ubuntu ~]# sudo /etc/init.d/vsftpd start

3. Stop Vsftpd Service :

root@ubuntu ~]# sudo /etc/init.d/vsftpd stop

4. Restart Vsftpd Service :

root@ubuntu ~]# sudo /etc/init.d/vsftpd restart

5. Edit the vsftp.conf

[root@ubuntu ~]# vi /etc/vsftpd.conf
Configure Vsftpd
Make the following changes of Vsftpd.conf on RHEL/CentOS/Fedora/Debian:
We don’t want anonymous login:
anonymous_enable=NO
Enable local users:
local_enable=YES
The ftpuser should be able to write data:
write_enable=YES
Port 20 need to turned off, makes vsftpd run less privileged:
connect_from_port_20=NO
Chroot everyone:

Command បន្ថែមដើម្បីអោយ ftp មានសិទ្ធិ Read/Write/Execute បាន ៖​

[root@rhel6 ~]# getsebool -a | grep ftp
allow_ftpd_anon_write –> off
allow_ftpd_full_access –> on
allow_ftpd_use_cifs –> off
allow_ftpd_use_nfs –> off
ftp_home_dir –> on
ftpd_connect_db –> off
httpd_enable_ftp_server –> on
tftp_anon_write –> off
[root@rhel6 ~]#​ setsebool -P ftp_home_dir on
[root@rhel6 ~]#​​​ setsebool -P allow_ftpd_anon_write on
[root@rhel6 ~]# setsebool -P httpd_enable_ftp_server on