Hi all,
I am new in programming and I just joined a company that offers secure file transfer software components. So I firstly want to gather some selective information on why should I use Secure FTP instead of FTP? And why is SFTP better than FTP?
Thanks in advance!

Dani AI

Generated

Good notes from and . Add the practical, deployable detail developers need when choosing and running secure file transfer.

SFTP is the "SSH File Transfer Protocol" — it is implemented as an SSH subsystem (typically on TCP port 22) and uses SSH authentication (passwords or public keys). FTPS is FTP run over TLS/SSL; despite the similar names they are different protocols with different firewall and client-compatibility characteristics. See the OpenSSH documentation for how SFTP is provided by sshd and a short comparison of SFTP vs FTPS in practice ([OpenSSH sshd_config manual] and [FileZilla SFTP_vs_FTPS]).

A minimal server-side setup (OpenSSH) example:

# /etc/ssh/sshd_config
Subsystem sftp internal-sftp

Match Group sftpusers
    ChrootDirectory /home/%u
    ForceCommand internal-sftp
    AllowTcpForwarding no
    X11Forwarding no

Common user/setup commands (example flow):

groupadd sftpusers
useradd -m -g sftpusers -s /usr/sbin/nologin alice
passwd alice
chown root:root /home/alice
mkdir /home/alice/uploads
chown alice:sftpusers /home/alice/uploads

Operational tips and cautions:

  • SFTP uses a single TCP port (easier with firewalls). FTPS may require an open passive port range for data channels.
  • Prefer public-key authentication for automation and stronger access control.
  • Use chrooted SFTP users (see Match/ChrootDirectory above) to avoid giving shell access.
  • Check server logs (/var/log/auth.log or /var/log/secure) when troubleshooting authentication or session failures.
  • For bulk or delta syncs consider rsync over SSH; for simple remote copies use scp or sftp as appropriate.

References: [sshd_config manual] and a concise comparison of SFTP vs FTPS ([FileZilla SFTP_vs_FTPS]).

Recommended Answers

All 2 Replies

ftp transfers files in clear text. it also sends passwords in clear text. VERY unsecure.

Hi, first of all congratulation for job. Despite the similarity in name the two protocols are completely different. In FTP all data is passed back and forth between the client and server without the use of encryption. This makes it possible for an eavesdropper to listen in and retrieve your confidential information including login details. With SFTP all the data is encrypted before it is sentient across the network. Hope you will satisfy with my opinions. I wish you for your great career.
All the best!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.