How to Configure SFTP Access for cPanel Hosting Make it Rain Paper

  • SFTP, FTP/SFTP, FTP Accounts
  • 0

The guide below is designed to help you configure your SFTP client for secure file transfers with your cPanel hosting. While reading through this, always prioritize security by selecting strong authentication methods and keeping your software up-to-date.

Prerequisites

  • A cPanel hosting account with SFTP access enabled.
  • An SFTP client (e.g., Transmit, FileZilla, WinSCP, Cyberduck), etc.
  • Basic knowledge of SSH and file transfer protocols.

Understanding SFTP and FTP Access

SFTP (SSH File Transfer Protocol) allows for secure file transfers over a network. Unlike FTP, which uses port 21, SFTP operates over port 22 and utilizes SSH for encryption and secure authentication.

While WebHostingM provides FTP access for most hosting accounts, users of free hosting services must use the File Manager interface in cPanel to manage their files.

Key Differences Between SFTP and FTP

  • Security: SFTP encrypts the connection, whereas FTP does not.
  • Authentication: SFTP supports public key authentication, enhancing security.
  • Port Usage: SFTP uses port 22, while FTP uses port 21.

Setting Up Your SFTP Client

To configure your SFTP client, you will need the following information:

  • Hostname: The server's hostname (e.g., example_domain.com).
  • SSH Port Number: Default is 22.
  • Security Type: Ensure your client supports SFTP.
  • Username: Your SSH username (cPanel username or root user). Note that FTP users cannot authenticate via SFTP.
  • Password: Not required if using a private key.
  • Private Key: Path to your SSH private key file.

Choosing the Right Authentication Algorithm and Key Size

SSH supports several public key algorithms. Here are the recommended options:

  • RSA: Minimum key size of 2048 bits, preferably 4096 bits.
  • ECDSA: Recommended key size of 521 bits.
  • Ed25519: A newer algorithm; support is not universal yet.

Generate your keys using the following commands:

ssh-keygen -t rsa -b 4096
ssh-keygen -t ecdsa -b 521
ssh-keygen -t ed25519

Common Gotchas to Avoid

  • Ensure that the password authentication is disabled on your server for enhanced security.
  • Always use the full username format for FTP accounts (e.g., ftpuser@example_domain.com). SFTP does not support FTP accounts.
  • Do not attempt to connect via SFTP using the FTP user credentials.

 

See How To Generate And Add SSH Keys To Your cPanel

 

Did something look off? Or maybe you've got a killer idea to make this article even better? Don't be shy—give us a shout! We're always up for improvement.

Feeling creative? If you're itching to write something awesome, we're all ears! You can send your article ideas straight to our editorial team. We love fresh perspectives. Send us an email.


Did this answer help?

« Back