Jump to content


How do I transfer files via SSH?

  • Please log in to reply
5 replies to this topic

#1 RDX1


    Neowinian Senior

  • Joined: 09-April 04
  • Location: Seattle, WA

Posted 19 February 2006 - 21:32

With SSH, how would I transfer one large file on server A to server B?

#2 Vlad


    The Count

  • Joined: 19-November 01
  • Location: San Diego, California

Posted 19 February 2006 - 21:37

A variety of possibilities. You can use a sftp client, such as psftp [http://www.chiark.gr.../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

#3 OP RDX1


    Neowinian Senior

  • Joined: 09-April 04
  • Location: Seattle, WA

Posted 19 February 2006 - 21:38

Thanks, I will do some man pages on scp and more research on my own.

#4 r4dius



  • Joined: 01-July 05
  • Location: Rochester, NY (RIT)

Posted 03 March 2006 - 04:48

I prefer wget :]

#5 +BudMan


    Neowinian Senior

  • Tech Issues Solved: 129
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 18 March 2006 - 02:21

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


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.

#6 Scott.Mc



  • Joined: 25-March 06

Posted 25 March 2006 - 07:36

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.