10/01/2560

วิธีติดตั้ง และใช้งาน FTP Server บน CentOS (Linux) ด้วย vsftpd

File Transfer Protocol (FTP) คือ Protocol ที่ใช้สำหรับการแลกเปลี่ยน และัจัดการไฟล์ต่าง ๆ บนเครือข่าย TCP/IP เช่น Internet โดย FTP นั้นมีรูปแบบการทำงานแบบ Client - Server โดยบนความนี้สอน วิธีการติดตั้ง FTP Server บน CentOS 6 ด้วยโปรแกรม vsftpd

ขั้นตอนการติดตั้ง FTP Server บน CentOS 6 ด้วยโปรแกรม vsftpd

1. ดาวน์โหลดโปรแกรม vsftpd
1
# yum install vsftpd
2. Start Service vsftpd
1
# service vsftpd start
3. เปิดการใช้งาน vsftpd ใน Multi-user levels
1
# chkconfig vsftpd on
4. ปิด Firewall
1
2
3
# service iptables stop
# chkconfig iptables off
# chkconfig ip6tables off
5. ทดสอบโดยการเปิดโปรแกรมเว็บเบราว์เซอร์แล้วพิมพ์ URL เป็น ftp://IP_SERVER เช่น ftp://192.168.0.152


ขั้นตอนการสร้าง Account FTP ให้กับแต่ละคน (FTP แบบ Authentication Required)

1. แก้ไขไฟล์ vsftpd.conf โดยพิมพ์คำสั่ง แก้ไขค่าตามคำอธิบายด้านล่าง และทำการบันทึก
1
# vi /etc/vsftpd/vsftpd.conf
1.1 ascii_upload_enable=YES ลบเครื่องหมาย # ออก
1.2 ascii_download_enable=YES ลบเครื่องหมาย # ออก
1.3 ftpd_banner=Welcome to blah FTP service. ลบเครื่องหมาย # ออก
1.4 use_localtime=YES เพิ่มไว้ที่บรรทัดสุดท้าย

2. สร้าง Account ใหม่ขึ้นมาสำหรับการทดสอบ
1
2
3
4
5
6
7
# useradd ftp1
# passwd ftp1
Changing password for user ostechnix.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
3. Restart Service vsftpd
1
# service vsftpd restart
4. Update SELinux configuration เพื่อเปลี่ยน User ไปที่ $HOME directories
1
# setsebool -P ftp_home_dir on

5. ทดสอบการเชื่อมต่อ FTP จากโปรแกรม Filezilla โดยให้ทำการใส่ Username และ Password จากที่สร้างในขั้นตอนที่ 2




6. หากต้องการใช้งาน ftp จาก Command Line Tool ให้ติดตั้งโปรแกรม ftp
1
# yum install ftp
7. ทดสอบการเชื่อมต่อ FTP ผ่าน Command Line
1
# ftp 192.168.0.152

เครดิต : ลิงค์

ไม่มีความคิดเห็น:

แสดงความคิดเห็น