How to test sftp connection and file transfer via CLI?

This article provides steps to troubleshoot and further test SFTP file transfer.

  • A sftp users credentials with permissions to read and/or write to the intended source/destination folder.

Testing Connection:

  1. To test the connection to your SFTP server, please follow the syntax below:
HTML
Copy
    1. sftp : sftp protocol/command
    2. -P: Port enabled for sftp connections on the SFTP server. By default this is 22.
    3. your_sftpuser: The sftp user that is allowed to establish connections.
    4. your_sftp_server_IP: destination SFTP server
  1. If the connection is successful, you will get a prompt to enter your sftp user password.

  2. If the connection is not successful, you can run the same command and add a -v flag before the port flag to obtain more debug information.

Testing File Transfer:

To test the transfer of files you can:

  1. Locate/Move to the destination/source folder of your remote machine. This will set the folder where you will uploading files from; or where you will be downloading files to.
HTML
Copy
  1. (Optional) Move to the source or destination of your local SFTP server:
HTML
Copy
  1. To upload files to your SFTP server:
HTML
Copy
  1. To download files from your SFTP server:
HTML
Copy

Check Folder Permissions

  1. To check the permissions on a folder, you can run the command below from inside an sftp session
HTML
Copy

If Further Assistance is required, please proceed to log a support case or chat with our support engineer.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard