transfering files through ssh
August 28th, 2006 mysurface Posted in Admin, scp | Hits: 68100 | 7 Comments »
As long as you can access a site with ssh account, then you can transfer files using scp, try to imagine , you are from host A and you have access to host B through ssh with same user account call foobar. You can copy a file from host B by example as bellow
scp foobar@hostB:~/myfile.txt .
:~/ actually leads you to home directory of foobar, as long as the file is accessible by the account foobar in host B, than it can be transfer. The other way round is transfer file from host A to host B.
scp myfile.txt foobar@hostB:~/
It support to copy a folder from one host to another by adding option -r
scp -r foobar@hostB:~/myfolder .
Copy from one host to another with different ssh account.
scp foobar@hostB:~/myfile.txt root@hostF:~/







August 28th, 2006 at 1:27 am
[...] If you want to transfer one or few files which you have know the location, scp would be enough. SCP example will be here. But if do not know the location of the file, and you want to login to browse the directories? consider sftp. Login to sftp is like login to ssh, sftp foobar@192.167.8.9 [...]
January 28th, 2007 at 9:42 am
[...] zssh, ZModem ssh, an alternative way to ssh and scp? To perform file transfer and ssh in ordinary way you need ssh and scp. [...]
May 20th, 2010 at 8:04 pm
thanks a lot, it’s the last i need know for manage my server
:D
October 6th, 2010 at 2:05 am
Cool! thanks
December 23rd, 2010 at 8:24 pm
Consider using rsync. It supports ssh and remote sources, but it uses a lot less bandwidth only transferring what needs to be changed rather than everything like scp.
You need rsync on both servers, however.
August 18th, 2011 at 3:11 am
good one!!
makes my life easier
June 22nd, 2012 at 8:43 pm
I would like to thank you for the efforts you have put in writing this web site. I am hoping the same high-grade blog post from you in the upcoming as well. In fact your creative writing skills has inspired me to get my own website now. Really the blogging is spreading its wings rapidly. Your write up is a great example of it.