By default, a new FTP account created in cPanel will have a Directory set as domain.com/username. This is almost never what's needed and leads to a successful FTP connection, showing no files and not being able to browse the directory structure.
This article with cover how to check and change the Directory of an FTP account.
Related Articles
Connect via FTP and Upload Files via FileZilla
Reset FTP Account Password
Create FTP Account
Check FTP or SFTP Logs
Change FTP User Home Directory
- Log into the appropriate cPanel
- Navigate to FTP Accounts in cPanel, located in the Files section
- Confirm that the current path is not the home directory or the website's document root
TIP: You can click the ... to expand the full path as shown in the above screenshot. - Back in cPanel, navigate to User Manager, within the Preferences section
TIP: Alternatively, the FTP User's home directory can be changed using cPanel's API within CLI. - Locate the FTP account in question and select Edit
NOTE: If an email account and an FTP account have the same name, both will be displayed here. Be sure to select the one that ONLY has the Truck/FTP icon in blue. The Mail folder will be greyed out. - Scroll down to the Services section
- Within the FTP box, modify the Home Directory setting
NOTE: Change this to be the website's document root or simply leave it blank to allow the FTP account to have full access to the home/ directory. - Click Save
CAUTION: For linked accounts, there will be a notice in the upper right-hand corner as shown below when going to Edit the User. In order to reset the FTP path, the password has to be set. This will cause the FTP password and the email password for the account to be the same. If this isn't the desired behavior, it may be preferable to unlink the account.
Change the Home Directory Using cPanel API
- SSH into the appropriate server
- Use the following command to change the home directory of an FTP user
uapi --user=userna5 Ftp set_homedir user=example1 domain=example.com homedir=example1/
REPLACE: Update userna5 to the appropriate cPanel username, change example1 to the FTP user name, change domain.com to the specific domain name, and change example1/ to the proper directory. If the customer wants this FTP User to see everything possible, you would use homedir=/ which would be /home/userna5/. - Log into the appropriate cPanel
- Navigate to FTP Accounts in cPanel, located in the Files section
- Confirm that the current path has been updated correctly
Comments
0 comments
Article is closed for comments.