How to Configure Your SFTP Client for Secure cPanel Access

This article explains how to configure your SFTP client to securely connect to your cPanel account, what connection details are required, how SFTP differs from FTP, and how to manage or deny FTP access. It also covers how to edit FTP server configurations from the command line for both ProFTP and Pure-FTP environments.

SFTPcPanel FTPServer Configuration

~3 min read · Updated Feb 18, 2026

1. Introduction to SFTP Connection


The SFTP protocol provides a secure method for file transfer using an SSH connection. Unlike common assumptions, SFTP is not a secure version of FTP; it is a completely separate protocol that offers file access, transfer, and management capabilities.


2. Required Information for Configuring Your SFTP Client


To connect to a server, SFTP clients typically require the following information:


Item Description Example
Hostname The server's hostname hostname.example.com
SSH Port The port used by the SSH service 22
Security Connection type (FTP or SFTP) SFTP
Username The SSH username (cPanel user or root) example / root
Password The SSH user’s password luggage12345
Private Key The path to the SSH private key on your device c:\data\id_dsa

Important: You cannot connect via SFTP using an FTP account.


Example Private Key Path

c:\data\id_dsa

3. How to Deny FTP Access


If the /etc/ftpusers file exists on your server, all users listed in this file will be denied FTP access.


Note: If the file does not exist, you must create it manually.


Example ftpusers File

user1
user2
user3

To deny FTP access for an FTP user, you must block the cPanel account that owns that FTP user.


4. Editing FTP Server Configuration from the Command Line


To edit your FTP server configuration, you must first determine which FTP server is installed. Run the following command:


grep ftpserver /var/cpanel/cpanel.config

The output will be one of the following:


  • ftpserver=proftpd
  • ftpserver=pure-ftpd

5. ProFTP Configuration


To edit ProFTP settings, follow these steps:


  1. Create or edit the /var/cpanel/conf/proftpd/local file.
  2. Add your configuration changes.
  3. Apply the changes using the following command:

/scripts/setupftpserver proftpd --force

ProFTP managed_settings Options


The Proftpd.pm file contains configurable managed_settings options. To view the file:


cat /usr/local/cpanel/Cpanel/FtpUtils/Config/Proftpd.pm

Example snippet from the file:


sub new {
    my $class = shift;
    my $self  = $class->SUPER::_init();
    $self->{'managed_settings'} = {
        'maxinstances' => {
            'name'    => 'MaxInstances',
            'context' => { 'server' => 2, },
            'default' => 'none',
}

6. Pure-FTP Configuration


To edit Pure-FTP settings, follow these steps:


  1. Create or edit the /var/cpanel/conf/pureftpd/local file.
  2. Add your desired configuration. Example:

ForcePassiveIP: 203.0.113.0

To clear the value:


ForcePassiveIP: ~

Apply the changes with:


/scripts/setupftpserver pure-ftpd --force

Conclusion


By properly configuring SFTP and managing FTP settings, you can significantly improve the security and control of file transfers on your cPanel server. Using private keys, restricting unauthorized users, and editing server configurations through the command line are essential steps for professional server management.


Written & researched by Dr. Shahin Siami

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue