ssh-xfer 0.15

ssh-xfer is a tool for file transfer over SSH authentication agent.
ssh-xfer is a tool for file transfer over SSH authentication agent.

Ever been logged in to a remote host via SSH, and thought "OK, I need that file there"?

ssh-xfer is the answer!

ssh-xfer is a hackish but handy way of transferring files from remote hosts to your local computer. Firstly, you need to run a slightly modified SSH authentication agent program on your local computer. Patches are available for both OpenSSH and PuTTY, see below. If you haven't used a SSH agent program before, this article seems to be reasonable, or you can look at the OpenSSH/PuTTY docs.

You don't need any modifications to your ssh client or server programs - only the modified SSH authentication agent, and the extra ssh-xfer program.

Once you have the modified ssh-agent program running, you can use ssh-xfer. On the remote computer you want to grab files from, you need a compiled version of the ssh-xfer binary. This can be created by applying the OpenSSH patch below to an OpenSSH 3.8.1p1 directory, ./configure, then make ssh-xfer.

To test it out, SSH to the remote host, making sure agent forwarding is on. Then try:

ssh-xfer somefilehere.txt

The file should magically appear at your local ~/Desktop, or on your Windows desktop with the PuTTY patch. If you want a different path, edit the patch. You can also go

cat somefilehere.txt | ssh-xfer nametocallfile.txt -

if you want to tranfer stdin. This is particularly useful from within Mutt.

How it works

Step one: send the filename in a packet. And wait for a response.

Step two: send a chunk of data. Then another. Then another. Don't wait for responses, since SSH has windowing etc in the channel layer anyway. I've managed 500kB/sec over wireless, so it seems fast enough.

Step three: send a finish packet. And wait for a response.

If you want more details, look at ssh-xfer.c, or ssh-agent.c, from the OpenSSH patch.

Please, if you have any criticism, flames, comments, or patches to patches, don't hesitate to email me. And if you want to see the patch go upstream.... well.

last updated on:
August 9th, 2008, 7:12 GMT
license type:
GPL (GNU General Public License) 
developed by:
Matt Johnston
ROOT \ Security
Download Button

In a hurry? Add it to your Download Basket!

user rating 6



Rate it!

Add your review!