3

A project I'm on requires I upload some files to a vendor's remote server. I requested a secure connection, and suggested scp or https or sftp. In response, they stated they could grant me ssh access, but they didn't support scp.

I know you can have scp access without ssh access (via, say, http://sublimation.org/scponly/ ), but hadn't heard of ssh without scp before.

Aside from the question of why have the setup this way, is this possible? ssh without scp?

3
  • How come they "don't support" it? It's pretty much a zero-conf solution.
    – LiraNuna
    Oct 7, 2009 at 20:41
  • I wonder if they really know if they support it. Maybe they just know about the SSH part, and don't know they actually support file transfers as well? Just try...?
    – Arjan
    Oct 7, 2009 at 20:45
  • Yeah, I plan on just trying it to see. Thanks!
    – kitt
    Oct 7, 2009 at 22:13

3 Answers 3

6

Apparently, it is possible (according to post #3 at that link). The trick is in the authorized_keys file format. There are several options that allow the server to restrict SSH features based on what key was used to authenticate. The "command=" option allows the server administrator to attach a restriction on the public key -- something like

"any incoming connections that authenticate with this key will execute this command, regardless of what command might have been requested by the user".

It might prevent the execution of standard SCP and SFTP, but if it provides an interactive shell there's probably a way around it:

$ ssh user@host 'cat /some/where/whatiwant.txt' > igotit.txt
4
  • This also shows that what the client does has nothing to do with security (besides a false idea thereof). Once you have a shell you can do what you want. The feature is to limit to other commands Apr 24, 2010 at 14:55
  • 2
    Yeah, if you are trying to transfer non-media files over slow connections I use $ ssh remote.box.com "cat /dir/file | gzip" | gunzip > dir/file"
    – Jarvin
    Apr 26, 2010 at 19:45
  • Tar is a better choice than cat or gzip/gunzip for piping files through an ssh connection. It will transfer whole directory trees and preserve file permissions & timestamps. See here.
    – Kenster
    Apr 26, 2013 at 20:18
  • fixunix.com <-- dead link
    – IceArdor
    Jan 25, 2017 at 0:51
2

There is also FISH to get around precisely this irritating situation.

1

Although it's possible to disable scp and sftp and have only SSH access, typical setups with SSH access have scp and sftp access enabled since they all use the same family of protocols.

I use WinSCP to copy files to my server with an SSH setup all the time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .