Solved

How to Download File to Desktop via SSH

Posted on 2013-06-07
13
602 Views
Last Modified: 2013-06-08
Hello Experts,

I've just got finished researching this topic on the Internet and I am as confused as ever.  I am not a server person (I'm telling you this up front, so be gentle) so I really don't know what I am doing.

I am connecting to a remote server via SSH and Putty and I would like to download a file from that server to the Desktop of my Windows computer.  From everything I have been reading, it looks like I would use the SCP command, but what is the proper syntax?  Everything I've tried from the examples I've seen on other websites does not work.

Thanks!
0
Comment
Question by:OmniUnlimited
  • 5
  • 3
  • 3
  • +1
13 Comments
 
LVL 5

Expert Comment

by:DOSLover
ID: 39231005
If you do not need a 'secure' download, you can use plain/simple ftp. On windows, open a command window (start, run, cmd) and try the ftp command.
      ftp userid@yourserver (you will be prompted for password)
      get yourfilename

For a secure download, you can download free ftp GUI client like FileZilla (https://filezilla- project.org/download.php)  or WINSCP (http://winscp.net/eng/index.php). After installing any of these ftp client, you can connect to your server and then just drag and drop files needed from the server to your desktop.

Another option is to use command line secure ftp. Please see this link: http://java.sg/how-to-sftp-from-windows-command-prompt-using-psftp/
0
 
LVL 17

Author Comment

by:OmniUnlimited
ID: 39231025
Hi DOSLover, and thanks for the reply.

I probably should have made some points clear in my question:

1. I am not interested in alternatives to using SSH to download.  My question is very specific and requires only one answer.
2. I am not interested in having to read anything other than the answer that gets posted right here.  As I mentioned in my question, I just finished an exhaustive search of the Internet and I don't want to hear anything more from those old articles.

This is very simple.  I just need an expert to tell me which SSH command to use and its proper syntax in order to accomplish what I am trying to do.
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 39231075
scp username@hostname:/path/to/file /path/to/desktop/

i never used putty's scp or can't remember but i assume the syntax is the same (usin pscp instead of scp)

if you need more help, please include the exact command you type and the output, i'll install putty on a test machine if required
0
 
LVL 17

Author Comment

by:OmniUnlimited
ID: 39231092
Thanks for the reply skullnobrains.  Your answer is similar to that which I read about.

Here is the problem I was having with that:

Having tried the command it seems that the first parameter (username@hostname:/path/to/file) should refer to the remote server, which makes no sense since I am already logged into username@hostname.  The second parameter with no identifying remote information (/path/to/desktop) seems to definitely refer to the remote server because executing the command scp username@localhost:testfile.txt / from one of the server subdirectories will deposit testfile.txt right in the root directory of the server.  I am thinking that I would need username@hostname to somehow identify my computer, and its syntax to be more like scp /path/to/file username@hostname:/path/to/desktop but I have no idea what "username" and "hostname" would be if that were the case.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39231107
Since you have Putty, you also downloaded the manual.  In case you didn't, here is the doc page with links to all the different versions of the manual.
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 39231108
it does make sense. you are not supposed to type this command after you logged to the remote system. running scp on the server will let you download files to/from the server regardless where you are logged on from. the windows does not feature a ssh server so there is no way this would work.

you are supposed to use this from the windows shell and you do not need to login to the server with putty beforehad.

you need to download pscp.exe if you have not done so yet and stick it in the window's path if you want to be able to scp manually from any location without hassle. then type the provided command in the windows shell.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39231109
0
 
LVL 17

Author Comment

by:OmniUnlimited
ID: 39231112
Great, the server just went down.  I'll have to get back to you on this...
0
 
LVL 5

Expert Comment

by:DOSLover
ID: 39232052
Hi OmniUnlimited,
It will not work the way you are trying to do. You are logged on to the Server and trying to send file(s) to the desktop. The server doesn't 'know' or cannot reach the desktop - and even if does, it won't be able to 'push' the file to the desktop because for this to happen a ftp service should be running on the desktop - I doubt that based on you explanation.

What you need is a command(s) that can be used to connect to the server from the desktop and 'pull' the files from the server to the desktop. It can be plain ftp or secure ftp. There are specific commands, if you need help on that.
0
 
LVL 17

Author Comment

by:OmniUnlimited
ID: 39232359
Awesome, server is back up, I just tried running pscp using the instructions found at http://www.nber.org/pscp.html and the following syntax from the Windows Command Prompt:

pscp user@host:testfile.txt c:\Documents and Settings\User\Desktop

and I get a "More than one remote source not supported" error.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39232388
You probably still have Putty open.  Close it then run pscp.
0
 
LVL 26

Accepted Solution

by:
skullnobrains earned 500 total points
ID: 39232391
no, you forgot to add quotes around the destination and since there are spaces in the path...

pscp user@host:testfile.txt "c:\Documents and Settings\User\Desktop"
0
 
LVL 17

Author Closing Comment

by:OmniUnlimited
ID: 39232402
Nice, clean, elegant, and exactly to my specifications without sending me to read a bunch of web pages.  Thanks skullnobrains,  I really appreciate this great solution, but I really think your moniker is a bit misleading.  I think you are really big in the brains department.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now