Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a RHEL5 box with sftp access to a central server. No ssh, not anything else but sftp. SFTP is nice, but it's interactive. I've heard of scp variants that use sftp protocol under the hood, but can't find an RHEL RPM for those. So I'm looking for either a pointer to an RPM I can use, or a source package I can build to get this, or an alternate non-interactive sftp front end.

I have scp on the RHEL machine, but it clearly doesn't speak sftp because when I try I get "This service allows sftp connections only."

Anyone have any ideas?

share|improve this question
up vote 1 down vote accepted

cURL speaks SFTP.

yum install curl
share|improve this answer
Thanks, perfect! Using it is pretty ugly with SFTP only (you have to pass it a pubkey even though that's not needed for SFTP for instance, and the cmd line arg syntax is verbose and weird) but a couple of quick shell scripts and I'm good to go. (Don't know how to paste code samples into a comment or I'd do it here.) – GaryO May 11 '12 at 13:14

scp on modern linux uses sftp protocol if possible and falls back to scp if the server does not support sftp. so the answer is affirmative.

share|improve this answer
sorry, RHEL5's scp isn't "modern" enough (as I said in the question). Seems like cURL is the best option. – GaryO May 11 '12 at 13:14
hmm, my rhel 5.4 ssh includes sftp client too. not sure why yours do not. rpm -ql openssh-clients-4.3p2-41.el5.x86_64 | grep sftp -> /usr/bin/sftp – johnshen64 May 11 '12 at 15:52
@joshshen64: I have openssh-clients-5.3p1-70.16.amzn1.z86_64, and it has the sftp client, but that's not what I'm talking about. sftp is interactive (like ftp). I want an SCP-like command line (copy this file from here to there). Some versions of scp can use the sftp protocol apparently, but not mine. I think yours is older, so it probably doesn't either. Try connecting to an sftp-only server with your scp and you'll see what I mean. – GaryO May 15 '12 at 15:32
did you try sftp -b batchfile user@server? batchfile specifies all your you need to set up ssh key authentication, either passphraseless, or have ssh-agent set up to forward your credentials. – johnshen64 May 15 '12 at 16:08
not a bad idea. I needed to write a wrapper script around curl anyway (its options are fairly obnoxious), so I bet a similar wrapper script around sftp that created a batchfile would also work. Thanks for the suggestion! – GaryO May 16 '12 at 17:52

Your Answer


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.