LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-04-2004, 03:11 PM   #1
boreo
Member
 
Registered: Feb 2003
Location: Dominican Republic
Distribution: Slackware, FreeBSD, RedHat
Posts: 326

Rep: Reputation: 30
SSH Question about downloading files


HI everyone.
I'm running SSHD on my Linux box and I connect to it from a WindowsXP box with putty, I made a user and password on my Linux box to connect to it, now when I connect I see the home directory and everything, what I want to know is how do I transfer a file from Linux to WIndows, I try using the scp command but I guess I'm doing something wrong. This the command I used.

scp john@192.168.0.4:~/Documents/file_to_copy .

Where is the file suppose to be when I enter that command? and how would I tell the machine where to download the file to, for example download it to "c:\windows".. This is kind of confusing because when I read that command I understand that by the "." which mean "current directory" the file is copying itself on my linuxbox and not on my windows box. I hope you guys understand me. I read the man page.
 
Old 07-04-2004, 03:16 PM   #2
SBing
Member
 
Registered: Mar 2004
Posts: 519

Rep: Reputation: 35
Do you have to use a command line interface? If not, why not try WinSCP ? It's an open source SCP client with an easy to use GUI, when I used to use windows (all those years ago) I could never be bothered to use the command line interface - WinSCP makes things a lot easier, especially when you are moving multiple files.

If you want to use the command line interface, just say so and someone else will help you

:)

Steve
 
Old 07-04-2004, 03:24 PM   #3
boreo
Member
 
Registered: Feb 2003
Location: Dominican Republic
Distribution: Slackware, FreeBSD, RedHat
Posts: 326

Original Poster
Rep: Reputation: 30
Yes I want to learn how do it in command line.
 
Old 07-04-2004, 07:36 PM   #4
GaijinPunch
Member
 
Registered: Aug 2003
Location: Tokyo, Japan
Distribution: Gentoo
Posts: 130

Rep: Reputation: 22
A couple of questions:

1: What's the output? The comand looks legit to me, except perhaps one thing.
2: Try the command with the full path, and no the "~" shortcut.

scp john@192.168.0.4:/home/john/Documents/file_to_copy .

I've never really done Putty/SSH Linux->Windows copying... thinking maybe it doesn't know that a tilde is a shortcut to a homedir.
 
Old 07-04-2004, 11:13 PM   #5
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
You need to run scp(a utility called pscp.exe is available on Putty website, thats a Windows client) on the Windows box, not in the ssh session.
You open up the command prompt and execute something like this:
Code:
pscp john@192.168.0.4:/home/john/Documents/file_to_copy c:\windows
And GaijinPunch is right, you can't use tilde to represent your home dir because Windows command prompt shell won't recognise it, and even if it does the paths are different.
 
Old 07-05-2004, 01:40 PM   #6
boreo
Member
 
Registered: Feb 2003
Location: Dominican Republic
Distribution: Slackware, FreeBSD, RedHat
Posts: 326

Original Poster
Rep: Reputation: 30
Thanks guys, I will try pscp when I get home today. I know the way I'm typing the command works because I can copy files between my linux boxes with no problem with this command
scp user@host1:file user@host2:file

The error I get when trying to copy a file from Linux to windows is this one

ssh: connect to host 192.168.1.103 port 22: Connection refused
lost connection

Which is weird because I don't have a firewall up, I disable the WindowsXP firewall too.
 
Old 07-05-2004, 01:54 PM   #7
boreo
Member
 
Registered: Feb 2003
Location: Dominican Republic
Distribution: Slackware, FreeBSD, RedHat
Posts: 326

Original Poster
Rep: Reputation: 30
Problem solve...
Solution: pscp.exe
Thanks guys.
 
Old 07-06-2004, 02:16 AM   #8
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Just to clear things up you got connection refused because in order to specify user@host:/path/tofile as either the source or the target the host has to be running sshd, which means your Windows also needs to have sshd running.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
downloading and updating with ssh cb951303 Linux - Software 2 09-10-2005 08:51 AM
easy question on downloading files > 2gig peter72 Linux - Networking 3 04-20-2005 05:29 PM
gFTP Question about downloading files stuart Linux - Newbie 2 07-16-2004 01:59 AM
Downloading Files? BajaNick General 3 07-30-2003 02:34 AM
Downloading in SSH AMDPwred Linux - Software 5 03-06-2003 11:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration