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