SSH access is needed to connect to SFTP. On VPS and Dedicated Servers, SSH is enabled by default for the root user. Contact us to enable SSH for your hosting account.
Step 1: Generate Private and Public Keys in Windows
- Launch "Command Prompt" (open the Start Menu and type "cmd") and run the following command:
ssh-keygen -t rsa
- It will ask you to save your keys to C:\Users\username/.ssh/
id_rsa
. Press Enter. - It will ask for a passphrase. Leave it empty.
Press Enter, and then press Enter again. - Execute the following command to view the public key:
type .ssh\id_rsa.pub
Copy the public key (select the text and right-click to copy or press Shift + Enter). - Done!
Step 2: Authorize the Public Key
You need to authorize your public key to connect to SSH or SFTP.
How to authorize your public key in cPanel and DirectAdmin?
Step 3: Connect to SFTP
Using Command Prompt in Windows:
- Launch "Command Prompt" (open the Start Menu and type "cmd") and run the following command:
sftp -oPort=2022 username@server.example.com
*Replaceusername
with your cPanel/DirectAdmin username.
*Replaceusername
withroot
if you are connecting to a VPS/Dedicated Server as theroot
user.
*Replaceserver.example.com
with your server hostname or IP address. - Type in
yes
and pressEnter
if it asks, "Are you sure you want to continue connecting?". - Done!
Using FileZilla:
- Go to FileZilla > File > Site Manager > New Site.
- Enter the following details on the General tab:
Protocol: SFTP
Host: server.example.com
- do not use ftp.yourdomain.comPort: 2022
Logon Type: Key file
User:
Key file:
- Click "Browse", select "All files" (located at the bottom, right above the "Open" button), and select theid_rsa
(not id_rsa.pub) file you generated before.
*Enter your cPanel/DirectAdmin username in the User field.
*Enter root in the User field if you are connecting to a VPS/Dedicated Server as the root user.
*Replace server.example.com with your server hostname. - Click Connect.
- Click OK on the "Unknown host key" prompt. This prompt appears the first time you connect to a server.
- Wait for FileZilla to establish a connection.
- Done! You should now have been connected.
If you need to connect to the same SFTP server again, go to FileZilla > Site Manager > [select the server] > Connect.
FileZilla official video guide: https://www.youtube.com/watch?v=NO92-qh9X00
Uploading a Large Number of Files
When uploading a large number of files, create a compressed .zip
(not .tar.gz) archive, upload it, and uncompress it using File Manager or SSH. This method is faster than uploading individual files.
You can also limit the number of FTP connections instead.