~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_dsa3. 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
user3To 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.configThe output will be one of the following:
ftpserver=proftpdftpserver=pure-ftpd
5. ProFTP Configuration
To edit ProFTP settings, follow these steps:
- Create or edit the
/var/cpanel/conf/proftpd/localfile. - Add your configuration changes.
- Apply the changes using the following command:
/scripts/setupftpserver proftpd --forceProFTP managed_settings Options
The Proftpd.pm file contains configurable managed_settings options. To view the file:
cat /usr/local/cpanel/Cpanel/FtpUtils/Config/Proftpd.pmExample 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:
- Create or edit the
/var/cpanel/conf/pureftpd/localfile. - Add your desired configuration. Example:
ForcePassiveIP: 203.0.113.0To clear the value:
ForcePassiveIP: ~Apply the changes with:
/scripts/setupftpserver pure-ftpd --forceConclusion
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