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

Just with ssh ?

link|improve this question

feedback

2 Answers

up vote 2 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.

link|improve this answer
1  
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
feedback

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

Anyway:

(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
link|improve this answer
1  
tar cf - file -C sourcedir ... – akira Nov 7 '10 at 13:40
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.