User Tools

Site Tools


cs101:sftpfromlinux

This is an old revision of the document!


How to transfer files between Linux/Mac computers using SFTP from the Command Line

This information is provided for the Ubuntu/Debian editions of Linux used in the CS Department. Other Linux versions may vary.

What Is SFTP?

In Linux, you can use the Secure File Transfer Protocol (SSH File Transfer Protocol) (SCP) from the command line (CLI) (the sftp command) to securely copy files and directories between remote hosts.

In most cases, SFTP is preferable to FTP because of its underlying security features and ability to piggy-back on an SSH connection. FTP is an insecure protocol that should only be used in limited cases or on trusted networks. FTP is NOT available on CS Department computers.

How to Connect with SFTP

You can establish a SFTP connection by issuing the following command:

sftp [options] remote_username@remote_host

You will connect the the remote system and your prompt will change to an SFTP prompt.

  • Name of the account on the host computer (remote_username)
  • Hostname (i.e. FQDN) of the computer on which the source file resides (remote_host)

Options can include things like [-oPort=custom_port] if not connecting to the standard SSH port 22.

Once connected

cs101/sftpfromlinux.1599188420.txt.gz · Last modified: 2020/09/03 22:00 by localadmin