Learn how to use the default SFTP client in Linux and Unix operating systems

OpenSSH, which is a suite of secure networking utilities based on the SSH (Secure Shell) protocol, includes a command-line utility for interacting with SSH servers for file transfer purposes. This utility is simply called sftp.

How to use OpenSSH SFTP

Here's a brief overview of how to use the sftp command:

  1. Connecting to a Server:

    • To connect to an SSH server using SFTP, you would typically use the following command:

      sftp username@hostname
    • Replace username with your username on the server and hostname with the hostname or IP address of the server.

  2. Authenticating:

    • After executing the command, you will be prompted to enter your password for the specified username.

  3. Navigating Directories:

    • Once connected, you'll be in the SFTP interactive shell, similar to a command-line interface.

    • You can use commands like ls, cd, and pwd to navigate directories on the server.

  4. Transferring Files:

    • To upload a file from your local machine to the server, you can use the put command:

      put localfile.txt
    • To download a file from the server to your local machine, you can use the get command:

      get remotefile.txt
  5. Exiting SFTP:

    • To exit the SFTP session, you can use the exit command:

    • Or simply type exit and press Enter.

The sftp command-line utility provides a straightforward way to perform secure file transfers over SSH connections without needing a separate FTP client. It's often used in scripting and automation tasks where manual interaction isn't required.

Using OpenSSH SFTP with Couchdrop

Couchdrop supports the default sftp command natively. Simply switch out the hostname and credentials from the example above.


Last updated