I have access to 3 machines, A, B, and C. The only possible (ssh) connections are:

A -> B
B <-> C

I need to get files from A to C, so I could scp the files from A to B, and then scp them from B to C. However, B doesn't have much disk space, so this is not an option. Is there a way to scp files from A to C via B? Note, I don't have root access on any of the machines, so don't think I can set up any persistent tunnels, but correct me if I'm wrong!

I know this doesn't answer the question, but for those who don't know about rsync, or don't know how to use it to hop through a host, this could be a useful tip: use the '-e' option with rsync like this: A$ rsync <options> -e 'ssh B ssh' source C:destination
–
EddifiedApr 1 '14 at 21:44

-3 Copies between two remote hosts are transferred through the local
host. Without this option the data is copied directly between
the two remote hosts. Note that this option disables the
progress meter.

This is using port forwarding. The only limitation here is host B needs to be configured to allow port forwarding. Otherwise this should work fine.

In the way of explanation, -L and -R allow you to forward ports. In -L, the first port given is the port ssh will begin listening on the originating machine (host A), and it'll forward anything it receives on that port over your SSH connection to host B, then route to host C on port 22.

edit

I messed up the syntax slightly. It sets up a forward on your LOCAL machine.

Nearly all have been already said but here is my last penny: I use ProxyCommand variant without nc nor soc. Based on OpenSSH Proxies and Jumphost Cookbook I crafted a following configuration:

So we have following players:

HOME_HOST: it is from where we copy a file to the target host

HOP_HOST: we copy through this host (logged as HOP_USER)

TARGET_HOST: it is our destination (authenticated as TARGET_USER)

First I added my local public key from my home host .ssh/id_dsa.pub
to .ssh/authorized_keys at both hop and target hosts.
Yes, the same public key from the home host to both of them. Usually you would expect it is the HOP public key you have to add to the TARGET one.