Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Just with ssh ?

share|improve this question

2 Answers 2

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.

share|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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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