Colonel Serveur
Using SFTP and SCP Instead of FTP

Why You Should Stop Using Traditional FTP

File Transfer Protocol (FTP) has been used for decades to upload, télécharger, and manage files on remote servers. While it remains widely recognized, FTP has a major security weakness: usernames, mots de passe, and transferred data are often sent in plain text.

This means attackers who intercept network traffic can potentially capture login credentials and sensitive files.

Modern Linux servers should use secure alternatives such as SFTP ou SCP, both of which encrypt data transfers and authentication using SSH.

Understanding SFTP

Secure File Transfer Protocol (SFTP) is a file transfer system that operates over SSH. Unlike traditional FTP, SFTP was designed with security in mind from the beginning.

All communication between the client and server is encrypted, y compris:

  • Usernames
  • Passwords
  • File transfers
  • Directory listings
  • Administrative operations

Because SFTP uses SSH, no additional authentication system is required. If SSH access is available, SFTP is usually available as well.

Wordpress Hosting

Hébergement Web WordPress

À partir de 3,99 $/mois

Acheter maintenant

Benefits of SFTP

  • Encrypted file transfers
  • Secure authentication
  • File and directory management
  • Remote file editing support
  • Works through a single SSH port
  • Supported by most hosting platforms

SFTP provides an experience similar to traditional FTP while significantly improving security.

Popular SFTP Clients

Several graphical applications support SFTP and make file management easy.

FileZilla

Supported Platforms

  • Fenêtres
  • Linux
  • macOS

Protocols

  • FTP
  • FTPS
  • SFTP

FileZilla is one of the most popular file transfer applications and provides a familiar dual-pane interface.

WinSCP

Supported Platforms

Cheap VPS

Serveur VPS pas cher

À partir de 2,99 $/mois

Acheter maintenant
  • Fenêtres

Protocols

  • SFTP
  • SCP
  • FTP
  • FTPS

WinSCP includes advanced synchronization and scripting features, making it popular among system administrators.

Cyberduck

Supported Platforms

  • macOS
  • Fenêtres

Protocols

  • SFTP
  • FTP
  • FTPS
  • Cloud storage services

Cyberduck offers a clean interface and excellent integration with macOS.

Understanding SCP

Secure Copy Protocol (SCP) is another secure method of transferring files over SSH.

Windows VPS

Hébergement VPS Windows

Remote Access & Full Admin

Acheter maintenant

Unlike SFTP, SCP focuses primarily on file transfers rather than providing a complete remote file management interface.

SCP is often preferred for:

  • Server administration
  • Automated scripts
  • Backup operations
  • Bulk file transfers

Because SCP uses SSH encryption, credentials and transferred data remain protected during transmission.

Uploading Files with SCP

The basic SCP syntax for sending a file is:

scp local-file username@server:/remote/path/

Exemple:

scp index.php [email protected]:/home/bob/public_html/

This command uploads the local file index.php à:

/home/bob/public_html/

on the remote server while authenticating as user bob.

Downloading Files with SCP

To retrieve a file from a server:

scp username@server:/remote/file /local/destination/

Exemple:

scp [email protected]:/home/bob/public_html/index.php Downloads/

This downloads the remote file into the local Downloads directory.

Transferring Multiple Files

SCP supports wildcard transfers.

Exemple:

scp [email protected]:/home/bob/public_html/*.php Downloads/

This command downloads every PHP file from the remote directory.

Examples of wildcard usage:

*.php
*.html
*.log
backup-*

Wildcards can be used for both uploads and downloads.

Using Alternate SSH Ports

If your server uses a custom SSH port, specify it using the -P option.

Default SSH example:

scp [email protected]:/home/bob/public_html/*.php Downloads/

Custom SSH port example:

scp -P 22334 [email protected]:/home/bob/public_html/*.php Downloads/

Dans ce cas, SSH is listening on port:

22334

instead of the default port 22.

SFTP vs SCP

Fonctionnalité SFTP SCP
Cryptage Oui Oui
Uses SSH Oui Oui
Graphical Clients Oui Limité
Directory Browsing Oui Non
File Management Oui Limité
Transfer Speed Bien Usually Faster
Automation Bien Excellent

Choose SFTP When

  • You want a graphical interface
  • You need remote file management
  • Users are familiar with FTP-style applications
  • Regular file uploads and downloads are required

Choose SCP When

  • Maximum transfer speed is important
  • You need command-line automation
  • You are writing scripts
  • You are transferring files in bulk

Enabling Shell Access in cPanel Servers

Because both SFTP and SCP rely on SSH, users must have shell access enabled.

Grâce à WHM

  1. Log in to WHM as root.
  2. Ouvrir Modify an Account.
  3. Locate the account.
  4. Activer Shell Access.
  5. Enregistrez les modifications.

Once shell access is enabled, the account can authenticate using:

  • SSH
  • SFTP
  • SCP

What About FTPS?

FTPS is FTP enhanced with SSL/TLS encryption.

Unlike SFTP, FTPS is based on the original FTP protocol and adds encryption on top of it.

FTPS Advantages

  • Compatible with many FTP applications
  • Supports SSL/TLS encryption

FTPS Disadvantages

  • More complicated firewall configuration
  • Multiple ports may be required
  • Often requires additional server configuration

Because SSH is already present on most Linux servers, SFTP is generally easier to deploy and maintain than FTPS.

Root User Access

If root login through SSH is permitted, the root account can also use:

  • SCP
  • SFTP

Cependant, direct root access should be limited whenever possible.

A safer approach is:

  1. Connect using a normal user account.
  2. Use sudo when elevated privileges are required.

This improves accountability and reduces security risks.

Performance Considerations

While both SFTP and SCP encrypt data, SCP generally achieves slightly faster transfer speeds.

This happens because:

  • SCP uses a simpler transfer mechanism.
  • Less protocol overhead is involved.
  • Fewer file management operations occur during transfer.

For large backup transfers or automated deployments, SCP is often the preferred option.

For everyday website management, SFTP provides a more convenient experience.

Meilleures pratiques de sécurité

When using SFTP or SCP:

Use SSH Key Authentication

Instead of passwords, use SSH keys:

ssh-keygen -t ed25519

This significantly improves account security.

Désactiver l'authentification par mot de passe

Once SSH keys are configured, disable password-based logins where possible.

Change the Default SSH Port

Éloigner SSH du port 22 can reduce automated attack attempts.

Restrict Access by IP

Use firewalls to limit SSH access to trusted IP addresses.

Keep SSH Updated

Regularly update OpenSSH and your operating system to receive security patches.

Pensées finales

Traditional FTP should no longer be considered a secure file transfer solution for modern Linux servers. Because FTP transmits credentials and data insecurely, it exposes websites and servers to unnecessary risk.

SFTP and SCP provide secure, encrypted alternatives that leverage SSH for authentication and data protection. SFTP offers a user-friendly file management experience similar to FTP, while SCP delivers fast and efficient command-line file transfers.

For most hosting environments, replacing FTP with SFTP or SCP is one of the simplest and most effective security improvements you can make.

Partager cette publication

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *