How do I transfer files via SSH?


Recommended Posts

A variety of possibilities. You can use a sftp client, such as psftp [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html] (I think filezilla is capable of sftp as well). This behaves like a normal ftp client, but through an ssh tunnel. The server must support sftp connections for this to work.

The other way (and easiest for just one file) is via scp. scp is like the cp command, but over an ssh tunnel. The command works like this:

scp /path/to/my.file me@serverB:/path/to/destination/my.file

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I prefer wget :]

and WTF does that have to do with ssh?? wget is for retrieving files using HTTP, HTTPS and FTP.. NOTHING what so ever to do with ssh..

vlad got you started.. what sshd are you running? openssh? vserver from vandyke? it should support sftp no problem. Are you looking for windows client to use? if so winscp is FREE and a great little app that supports both sftp and scp. vandyke has a none free client that is good securefx. On a windows machine you could just use cygwin, etc.. etc..

http://winscp.net/

You can also just tunnel ftp through your ssh connection.. you can tunnel any method of file xfer through your ssh connection for that matter ;) Yes even wget - if done correctly ;)

Some exact details of what your trying to do would be helpful in helping you further.

Link to comment
Share on other sites

scp and rsync are probably the best.

Rsync is good for on the fly compression and also it will not copy data that's already there, which saves on bandwidth.

You can use it with lots of different switches, `man rsync` an example of copying /copy/me , to a remote server with [serverip] and putting the data in /where/to would be

rsync -avz -e ssh /copy/me login@serverip:/where/to

Also be careful of /'s for example

rsync -avz -e ssh /copy/me/ login@serverip:/where/to

Will copy everything inside the dir and not the dir.

-Scott

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.