Ssh – Transferring files via ssh but without scp or sftp

file-transferfusessh

I need to transfer files via ssh, but unfortunately scp and sftp are not viable, as the host I am connecting is just a "door" node that is redirecting me to a different machine available only on a private supercomputing network to which it is attached (and thus it's asking me for the password twice). For this reason, I cannot run any command on the door node.

I wonder if I can transfer files using some tool that uses the output (terminal) stream from the ssh connection.

The only alternative would be outputting the files in some handy format such as base64, copying them to clipboard and decoding them locally (and vice-versa).

I am starting to get frustrated using vim remotely. What I want to achieve is a rsync-like system in which I edit the source code of my program locally and then test it remotely, but as you can see, it is not that easy.

I might not be the only one that had this problem, so I guess that there must exists a tool that has this aim? (A solution with FUSE would be the best, but I know this may be asking too much).

Best Answer

I did not want to leave this as an answer but the comments section is gettinfg larger and you will get notification from SE to carry the conversation to a chat window.

So, hit enter a couple of times and type ~? no spaces. no nothing.

you should see something like this (or exactly like this)

Supported escape sequences:
  ~.  - terminate connection (and any multiplexed sessions)
  ~B  - send a BREAK to the remote system
  ~C  - open a command line
  ~R  - Request rekey (SSH protocol 2 only)
  ~^Z - suspend ssh
  ~#  - list forwarded connections
  ~&  - background ssh (when waiting for connections to terminate)
  ~?  - this message
  ~~  - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)

at this point type ~C and you should see ssh> prompt. At this point type

ssh> !scp /path/to/some/file/on/your/local/machine user@remoteserver

since you are already authenticated, it should transfer the file over the existing connection.

Related Question