Solved

How to Download File to Desktop via SSH

Posted on 2013-06-07
13
615 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 27

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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 27

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

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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

688 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