What is the difference between sftp and scp?
5 Answers
SCP is the abbreviation of 'secure copy', while SFTP stands for 'secure FTP'.
The first is used to copy one or more files, often with known names, from host A to host B, whereas the second is mostly used interactively, analogue to an FTP client. SCP will always work out of the box and has little in the field of tweakable options. SFTP can be used with different backends to present the SFTP service to the user. It would even possible to turn it off, though I haven't tried this.
That's the difference in use.
As far as performance goes: ErikA below links to a wikipedia page which mentions SCP is generally faster than SFTP because of a more efficient algorithm in SCP.

- 10,409
- 2
- 35
- 47
-
3SFTP is not secure FTP, but SSH File Transfer Protocol. Google/Wiki it – Bart van Heukelom Nov 17 '09 at 22:21
-
2I quote from Wikipedia.org's SFTP entry "In computing, the SSH File Transfer Protocol (**sometimes called Secure File Transfer Protocol or SFTP**)". Emphasis mine. kthxbai. – wzzrd Nov 18 '09 at 07:39
-
6I think his point was that SFTP is not simply a secured version of the FTP protocol but a different protocol entirely. – Dave Forgac Aug 17 '11 at 17:06
sftp is an interactive program used by human in a shell session scp is mostly an one-liner used in scripts to transfer/copy files

- 74
- 1
That's like asking the difference between cp and ftp.
scp lets you remotely copy a file to or from an SSH server. Generally, people only use scp if they are going to recusively upload a folder or upload just one file. There's also the fact that since scp is a one-liner,
sftp is an interactive program that let's you upload files to/from an SSH server. The advantage of using sftp over scp is that if you need to do multiple uploads from or to different directories, you can do it in one session.

- 934
- 5
- 12
-
5Those are properties of the client programs, not the protocols – Bart van Heukelom Nov 17 '09 at 22:22
-
Wikipedia removed the section as inaccurate, in case anyone is still interested in this topic. – Checo R Nov 13 '19 at 00:06
Security: Both SFTP and SCP provide same security features for they are based on the secure shell protocol. such as Secure Remote Logins, Secure File Transfer, Secure Remote Command Execution, Keys and Agents, Access Control and Port Forwarding
Functionality: SCP can tranfer files and non-interactive. Therefore, SCP transfer cannot be canceled without terminating the session. SFTP is interactive. SFTP capabilties includes directory listings, remote directories and files removal, creates directories and files and etc. SFTP can be used in batch process. SFTP can be used for multiple uploads from or to different directories in one session.
Speed: SCP is faster for it confirms recieved packets whilst SFTP has to acknowledge every packet.
Resume file transfer: SCP can not resume an interrupted file transfer whereas SFTP can with -a of the get command to resume partial transfers of existing files

- 11
- 1