OpenSSH SFTP
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:
Connecting to a Server:
To connect to an SSH server using SFTP, you would typically use the following command:
sftp username@hostnameReplace
usernamewith your username on the server andhostnamewith the hostname or IP address of the server.
Authenticating:
After executing the command, you will be prompted to enter your password for the specified username.
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, andpwdto navigate directories on the server.
Transferring Files:
To upload a file from your local machine to the server, you can use the
putcommand:put localfile.txtTo download a file from the server to your local machine, you can use the
getcommand:get remotefile.txt
Exiting SFTP:
To exit the SFTP session, you can use the
exitcommand:exitOr simply type
exitand 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.
sftp [email protected]Last updated
Was this helpful?