How to connect to SFTP?

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:

  1. Launch "Command Prompt" (open the Start Menu and type "cmd") and run the following command:

    sftp -oPort=2022 username@server.example.com

    *Replace username with your cPanel/DirectAdmin username.
    *Replace username with root if you are connecting to a VPS/Dedicated Server as the root user.
    *Replace server.example.com with your server hostname or IP address.

  2. Type in yes and press Enter if it asks, "Are you sure you want to continue connecting?".

  3. 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.com
    Port: 2022
    Logon Type: Key file
    User:
    Key file: - Click "Browse", select "All files" (located at the bottom, right above the "Open" button), and select the id_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.

 

  • 384 Users Found This Useful
Was this answer helpful?

Related Articles

How to limit the number of FTP connections?

When uploading a large number of files, we recommend you limit the number of FTP connections....

How to upload a large number of files quickly via FTP or File Manager?

Uploading a large number of times usually takes a lot of time. Your computer and server traverse...

How to enable and access SSH?

SSH remains disabled by default on all hosting accounts (excluding VPS and Dedicated Server). If...

How to connect to SSH from Mac?

SSH access must be enabled for your hosting account (excluding VPS and Dedicated Server) to...

How to authorize your public key in cPanel and DirectAdmin?

cPanel and DirectAdmin provide a seamless interface to authorize your public key. Authorizing the...