Introduction
SFTP is a secure protocol, but cPanel FTP users cannot use SFTP. This is because SFTP requires a user to have shell access, which FTP users do not have. To provide SFTP access without providing a user with the cPanel account's credentials, you can create a user with the adduser
command and set the user's home directory to the directory to which you want the user to have FTP access.
Procedure
Please note that the following procedure assumes that you want to provide the new FTP account with access to a cPanel user's home directory. If you want to give the user access to a specific folder, replace "/home/$cpusername" with the full path to the folder.
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Use the
adduser
command to add the new user account.- RHEL-based
-
/home/$cpusername --gid $cpusername $ftpusername
Please note that "$cpusername" and "ftpusername" must be replaced with the username of the cPanel account the FTP user will access and the username for the new FTP account, respectively. - Run the
passwd
command for the new user.passwd $ftpusername
Please note that "$ftpusername" must be replaced with the username created above.
-
- Ubuntu
adduser --home /home/$cpusername --ingroup $cpusername --gecos GECOS $ftpusername
Please note that "$cpusername" and "ftpusername" must be replaced with the username of the cPanel account the FTP user will access and the username for the new FTP account, respectively.
- RHEL-based
- Enter the password for the new user.
- Re-enter the password.
- Ensure that the folders to which the new user has access have read and write permissions enabled for the group user.
chmod g+rw -R /home/$cpusername
Please note that "$cpusername" must be replaced with the username of the cPanel account the FTP user will access.