I'm wondering if I can make the assumption that I can get a file using scp on any server that I could get the file using sftp.


Mostly, yes. Both sftp and scp are file transfer protocols over ssh, and sftp is a more recent feature than scp, so while there are a few older setups with scp but no sftp, the converse would take some deliberate configuration.

However, it is possible for a server to allow sftp but not scp. One reason I can think of to configure a server this way is if you want to allow a single service over ssh, for simplicity's sake: sftp and scp provide the same level of access security-wise, but sftp is more convenient, so sftp is the preferable choice.

In other words, if the server can sftp, it can scp; but it might allow sftp and forbid scp.


Servers that have OpenSSH (which includes most *nix servers) run SFTP as a separate subsystem under it. It is feasible to disable just the SFTP subsystem, leaving only SSH and SCP available. See the sshd_config(5) man page for details.


scp comes with ssh. I'm not sure sftp is necessarily a part of it.


No, you can't assume that.

scp depends on SSH being available, which is not linked to SFTP being available.

~~edit: more details~~

ssh lets you do more than just copy files. It will allow you to run commands. So it is very easy to imagine a server that would allow you to sftp, but would not allow you to ssh.

  • Doesn't the S in SFTP stand for SSH? – PMV Dec 3 '10 at 22:06
  • 1
    more or less, yes, SFTP is just a more recent implementation of SCP, but SFTP is not run over SSH, it is a completely different protocol. – MaQleod Dec 3 '10 at 22:57
  • @MaQleod, @David: SFTP is an FTP-like protocol over SSH. You seem to have it confused with FTPS, which is a modification of FTP to use SSL. SFTP is carried over SSH; FTPS is independent. – Gilles 'SO- stop being evil' Dec 4 '10 at 0:21
  • @Gilles just because SFTP (as a technology) is based on ssh, doesn't I can ssh onto any server I can SFTP to. Plenty of our clients use SFTP to transfer files to us, but none of them could ssh to the same server. – David Oneill Dec 4 '10 at 0:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.