Usually, I use the scp command to transfer files on *nixes.
What's the difference between SFTP and SCP? Don't they both work on SSH?
|
Usually, I use the What's the difference between SFTP and SCP? Don't they both work on SSH? |
||||
|
|
|
In a nutshell, SCP can only be used for transferring files, and it is non-interactive (i.e., everything has to be specified on the command line). SFTP is more elaborate, and allows interactive commands to do things like creating directories, deleting directories and files (all subject to system permissions, of course), etc. |
|||||||||||||||||
|
|
From Wikipedia:
and
|
|||||||||
|
|
From a purely command line perspective :
Other important difference between the 2 commands is that sftp cannot put a local file to a remote location using a single command line, although it can get remote file, while scp can do both. sftp get remote file
scp get remote file
scp put remote file
|
|||
|
|
|
SSH (Secure SHell) is a cryptographic network protocol to allow remote login and other network services to operate securely over an unsecured network. Differences: SFTP is works on interactive mode (session) and SCP works on non-interactive. Using SFTP we can access remote file system i.e. creating, deleting, and listing files. Similarities: Both SCP(Secure Copy Protocol) and SFTP (SSH File Transfer Protocol) are network protocols, which supports file management between hosts on a network. Both uses SSH. |
||||
|
|
|
Most differences of the two protocols have already been said in other answers, and more verbosely in https://unix.stackexchange.com/q/8707/19088 Another difference, according to the documentation of curl, is that the SCP protocol is not very portable and usually only works between Unix systems. By the way, curl implements both protocols and unlike the default OpenSSH SFTP client implementation, it is non-interactive for both SFTP and SCP. And note that there is also the FISH protocol, which allows you to transfer files via SSH without the need of SCP or SFTP. As far as I know FISH is not very popular, currently implemented in just a few file managers (Midnight Commander and some that are KDE-based) and Lftp. |
||||
|
|