เว็บนี้มีลิงก์ affiliate — หากสมัครผ่านลิงก์ เราได้รับค่าคอมมิชชัน · Affiliate links. รายละเอียด

FTP และ SFTP คืออะไร ต่างกันอย่างไร ใช้งานอย่างไร

FTP vs SFTP: differences, security, how to use them, recommended clients, and best practices.

FTP และ SFTP คืออะไร ต่างกันอย่างไร ใช้งานอย่างไร
แนะนำAsiaGB.com — Web Hosting & VPS คุณภาพสูง พร้อมทีม Support ภาษาไทย 24 ชั่วโมง SSD NVMe uptime 99.9%

AsiaGB.com — Premium hosting & VPS with Thai support, NVMe SSD, 99.9% uptime.

เยี่ยมชม AsiaGB →

FTP คืออะไร

FTP (File Transfer Protocol) คือ Protocol สำหรับถ่ายโอนไฟล์ระหว่าง Client และ Server ผ่าน Network ใช้ Port 21 (Control) และ Port ที่สุ่มสำหรับ Data Transfer ปัญหาหลักคือส่งข้อมูล รวม Password เป็น Plaintext ทำให้ไม่ปลอดภัยบน Network ที่ไม่น่าเชื่อถือ

FTP (File Transfer Protocol) transfers files between client and server over networks using Port 21 (control) and random data ports. The main problem: it transmits data including passwords as plaintext, making it insecure on untrusted networks.

SFTP คืออะไร

SFTP (SSH File Transfer Protocol) คือ Protocol ถ่ายโอนไฟล์ที่รัน บน SSH (Secure Shell) เข้ารหัสข้อมูลทั้งหมดรวม Authentication ใช้ Port 22 เดียวกับ SSH ปลอดภัยกว่า FTP มาก แนะนำให้ใช้ SFTP แทน FTP เสมอถ้าเป็นไปได้

SFTP (SSH File Transfer Protocol) transfers files over SSH (Secure Shell), encrypting all data including authentication. Uses Port 22 (same as SSH). Much more secure than FTP — always prefer SFTP over FTP when possible.

FTP vs SFTP ต่างกันอย่างไร

ความต่างหลัก: FTP ไม่เข้ารหัส ส่ง Password เป็น Plaintext ใช้ Port 21 SFTP เข้ารหัสด้วย SSH ใช้ Port 22 FTP ใช้งานบน Shared Hosting ง่ายกว่าเพราะไม่ต้องการ SSH Access บาง Shared Hosting ไม่มี SFTP ให้ FTPS คือ FTP บน SSL เป็นทางเลือกกลาง

Key differences: FTP is unencrypted, sends passwords as plaintext, uses Port 21. SFTP is SSH-encrypted, uses Port 22. FTP is easier on shared hosting not requiring SSH access. Some shared hosts don't offer SFTP. FTPS is FTP over SSL — a middle option.

FTP Client ที่แนะนำ

FileZilla: ฟรี Open Source ดีที่สุด รองรับ FTP, SFTP, FTPS WinSCP: Windows ฟรี ดีมาก รองรับ SFTP/SCP Cyberduck: Mac/Windows ฟรี UI ดี Transmit: Mac ดีที่สุดสำหรับ Mac แต่เสียเงิน Command Line: sftp และ scp ใน Terminal

FileZilla: free open source, best overall, supports FTP/SFTP/FTPS. WinSCP: free Windows client, excellent SFTP/SCP support. Cyberduck: free Mac/Windows with good UI. Transmit: best Mac client but paid. Command line: sftp and scp in Terminal.

ตั้งค่า FTP ใน Hosting

ใน cPanel ไปที่ FTP Accounts → สร้าง Username, Password, Directory ที่อนุญาต และ Quota FileZilla ใส่ Host (domain หรือ IP), Username, Password, Port (21 สำหรับ FTP, 22 สำหรับ SFTP) เลือก Protocol ที่ถูกต้อง

In cPanel, go to FTP Accounts → create Username, Password, allowed Directory, and Quota. In FileZilla, enter Host (domain or IP), Username, Password, Port (21 for FTP, 22 for SFTP), and select the correct protocol.

Passive vs Active FTP Mode

Firewall มักบล็อก Active FTP Mode เพราะ Server เป็นคนเริ่ม Data Connection ไปที่ Client Passive Mode: Client เริ่ม Data Connection เอง ผ่าน Firewall ได้ง่ายกว่า ถ้าเชื่อมต่อ FTP ไม่ได้ให้ลอง Passive Mode ก่อน

Firewalls often block Active FTP Mode because the server initiates the data connection to the client. Passive Mode: the client initiates the data connection, passing through firewalls more easily. If FTP connection fails, try Passive Mode first.

ความปลอดภัย FTP/SFTP

ถ้าใช้ FTP ควรใช้ FTPS (FTP over SSL) หรือ SFTP แทน ปิด Plain FTP ถ้า VPS ของตัวเอง จำกัด FTP Access ด้วย IP Whitelist ใช้ Password แข็งแกร่งหรือ SSH Key Authentication สำหรับ SFTP ตรวจสอบ FTP Log สม่ำเสมอ

Use FTPS or SFTP instead of plain FTP. Disable plain FTP on your own VPS. Restrict FTP access with IP whitelisting. Use strong passwords or SSH Key Authentication for SFTP. Regularly check FTP logs.

การใช้ FTP ทั่วไปใน Hosting

อัพโหลดไฟล์เว็บไซต์ (HTML, PHP, CSS, JS), ดาวน์โหลด Backup ไฟล์, Edit ไฟล์โดยตรง (บาง Client ทำได้), ย้ายไฟล์ระหว่าง Directory, อัพโหลดรูปภาพจำนวนมากในครั้งเดียว และ Deploy Code จาก Local ไป Production

Common FTP uses in hosting: uploading website files (HTML, PHP, CSS, JS), downloading file backups, editing files directly (some clients support this), moving files between directories, bulk image uploads, and deploying code from local to production.

FTPS คืออะไร

FTPS (FTP Secure หรือ FTP over SSL/TLS) คือ FTP ที่เพิ่ม Encryption ด้วย SSL/TLS ต่างจาก SFTP (ที่ใช้ SSH) Explicit FTPS: เริ่มต้นเป็น FTP แล้ว Upgrade SSL Implicit FTPS: SSL ตั้งแต่ต้น Port 990 ซับซ้อนกว่า FTP ธรรมดาแต่ปลอดภัยกว่า

FTPS (FTP Secure or FTP over SSL/TLS) adds SSL/TLS encryption to FTP — different from SFTP (which uses SSH). Explicit FTPS: starts as FTP then upgrades to SSL. Implicit FTPS: SSL from the start on Port 990. More complex than plain FTP but more secure.

คำถามที่พบบ่อย (FAQ)

FileZilla ใช้งานอย่างไรเบื้องต้น?
1. เปิด FileZilla 2. File → Site Manager → New Site 3. Protocol: SFTP 4. Host: your-domain.com 5. Port: 22 6. Username และ Password ตาม Hosting 7. Connect กด OK แล้วตอบ Yes ถ้าถาม Trust Host Key 8. ซ้าย = Local คอมพิวเตอร์ ขวา = Server
SFTP ต่างจาก SSH อย่างไร?
SSH ใช้สำหรับ Command Line Access บน Server SFTP ใช้ Port เดียวกัน (22) แต่เป็น Subsystem ของ SSH ที่ทำ File Transfer โดยเฉพาะ ทั้งคู่ใช้ Credential เดียวกัน แต่ Application ต่าง (SSH = Terminal, SFTP = File Transfer)
อัพโหลด WordPress ผ่าน FTP ทำอย่างไร?
1. Download WordPress.org 2. Unzip 3. FileZilla เชื่อมต่อ Server 4. นำทางไป /public_html/ 5. Drag ไฟล์ทั้งหมดจาก WordPress Folder ไปใน Remote Panel 6. รอ Upload เสร็จ 7. ไป Browser เปิด domain.com ทำ Wizard ต่อ
FTP ล่ม Connection ถูก Drop ทำอย่างไร?
ลอง: 1. ใช้ Passive Mode 2. ลด Transfer Queue (อัพทีละน้อยชิ้น) 3. เพิ่ม Timeout ใน FileZilla Settings 4. ถ้าใช้ WiFi ลอง LAN แทน 5. ถ้า Firewall Block ตรวจสอบ Port 21/22 6. ติดต่อ Hosting Support ถ้าปัญหายังอยู่