Thursday, April 10, 2014

What is SFTP, and how do I use an SFTP client to transfer files?

On this page:

Overview

The SSH File Transfer Protocol (also known as Secure FTP and SFTP) is a computing network protocol for accessing and managing files on remote file systems. SFTP also allows file transfers between hosts, similar to the SCP protocol. Unlike standard File Transfer Protocol (FTP), SFTP encrypt commands and data both, preventing passwords and sensitive information from being transmitted in the clear over a network.
SFTP clients are programs that use SSH to access, manage, and transfer files. SFTP clients are functionally similar to FTP clients, but they use different protocols. Consequently, you cannot use standard FTP clients to connect to SFTP servers, nor can you use clients that support only SFTP to connect to FTP servers. Graphical clients are available for SFTP, or you can use it from the command line on a Unix or Mac OS X computer.

Graphical SFTP clients

Graphical SFTP clients simplify file transfers by allowing you to drag and drop icons from one window to another. Each icon represents a file or directory, and each window represents a computer's file system. When you open the program, you specify the name of the remote host to which you want to connect, and then authenticate with your username and password for that host.

Command-line SFTP

You can use SFTP from the command line on Unix and Mac OS X computers. To start an SFTP session, at the command prompt, enter:
sftp username@host
For example, if your username is dvader, to connect to your account on the host empire.gov, enter:
sftp dvader@empire.gov
Enter your password when prompted.
Some standard command-line SFTP commands include:
CommandFunction
cdChange the directory on the remote computer.
chmodChange the permissions of files on the remote computer.
chownChange the owner of files on the remote computer.
exit (or quit)Close the connection to the remote computer and exit SFTP.
getCopy a file from the remote computer to the local computer.
help (or ?)Get help on the use of SFTP commands.
lcdChange the directory on the local computer.
llsList the contents of the current directory on the local computer.
lmkdirCreate a directory on the local computer.
ln (or symlink)Create a symbolic link for a file on the remote computer.
lpwdShow the current directory (present working directory) on the local computer.
ls (or dir)List the contents of the current directory on the remote computer.
lumaskChange the local umask value.
mkdirCreate a directory on the remote computer.
putCopy a file from the local computer to the remote computer.
pwdShow the current directory (present working directory) on the remote computer.
renameRename a file on the remote computer.
rmDelete a file on the remote computer.
rmdirRemove a directory on the remote computer (the directory usually has to be empty).
versionDisplay the SFTP version.
 ! Exit to the Unix shell prompt, where you can enter commands. To get back to SFTP, enter exit. If you combine  ! with a command (e.g., !pwd), SFTP will execute the command without dropping you to the Unix prompt.

No comments:

Post a Comment