Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

4 Answers 4

up vote 2 down vote accepted

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer
    
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 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

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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