?
Solved

How to Download File to Desktop via SSH

Posted on 2013-06-07
13
Medium Priority
?
617 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month13 days, 1 hour left to enroll

777 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