Solved

How to Download File to Desktop via SSH

Posted on 2013-06-07
13
598 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
0
 
LVL 17

Author Comment

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

Expert Comment

by:DOSLover
Comment Utility
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
Comment Utility
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 82

Expert Comment

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

Accepted Solution

by:
skullnobrains earned 500 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.:

771 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

9 Experts available now in Live!

Get 1:1 Help Now