Do all servers equipped with sftp have scp?

2

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.

PMV

Posted 2010-12-03T21:28:13.917

Reputation: 157

Answers

3

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.

Gilles 'SO- stop being evil'

Posted 2010-12-03T21:28:13.917

Reputation: 58 319

3

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.

Ignacio Vazquez-Abrams

Posted 2010-12-03T21:28:13.917

Reputation: 100 516

0

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

Broam

Posted 2010-12-03T21:28:13.917

Reputation: 3 831

0

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.

David Oneill

Posted 2010-12-03T21:28:13.917

Reputation: 2 381

Doesn't the S in SFTP stand for SSH? – PMV – 2010-12-03T22:06:59.780

1more 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 – 2010-12-03T22:57:23.467

@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' – 2010-12-04T00:21:03.867

@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 – 2010-12-04T00:58:10.330