Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

Can I upload files to a server without using ftp or sftp ?

Just with ssh ?

share|improve this question
up vote 3 down vote accepted

ssh is a connection method but inherently does not 'do' file transfers. You could run commands like tar and cat via ssh but there are specific utilities that are better suited to file transfers with ssh - have a look at scp and rsync.

share|improve this answer
essentially scp and rsync do not differ from tar since they ALL tunnel via ssh. especially rsync talks to its counterpart exactly the same way as does tar: via a pipe... – akira Nov 7 '10 at 13:39

All SSH implementations I know do include SFTP, so I don't see why would you not want to use it.


(cd sourcedir && tar cf - file otherfile) | ssh host "cd targetdir && tar xvf -"

Or for a single file, without preserving metadata:

ssh host "cat > targetfile" < sourcefile
share|improve this answer
tar cf - file -C sourcedir ... – akira Nov 7 '10 at 13:40

You must log in to answer this question.

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