LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 11-02-2004, 01:07 PM   #1
mhague
LQ Newbie
 
Registered: Nov 2004
Location: Irvine, CA
Posts: 3

Rep: Reputation: 0
Unhappy SCP Copy from Linux to Windows?


Hi,
I am very new to Linux, but have figured out how to use SCP to copy a file from Linux box to Linux box. I am using a private key so I won't have to enter a user and password. This works great!

This is a process that needs to happen each day (I've scripted it), and my ultimate goal is to get the file from the Linux box to my Windows PC.

Can SCP be used to copy the file from Linux to Windows directly? If so, can I still use the same key to authenticate? Where does the key file reside on my Windows PC?

I tried using PSCP (from Windows) to 'get' the file from Linux. I'm getting 'connection timed out'. If PSCP is the only option, again, can I use the key to authenticate?

Thanks for any help! I've spent some time on this and am kind of frustrated at this point.

Marcie
 
Old 11-02-2004, 02:04 PM   #2
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
Not sure about a push from Linux to Windows... However it would be possible to pull it.

Here's my command to pull in the file I want:
c:\downloads\pscp -pw password blink@192.168.0.5:/home/blink/junk c:\foo\

I created a batch file to run called it c:\stupid.bat and put the command to run in it and verified it would run when i typed 'c:\stupid.bat'

I then go on my windows box and create a scheduled task.
Start --> Programs --> Accessories --> System Tools --> Scheduled tasks
It takes you through a Wizard to set it up. Put c:\stupid.bat in for the command to run.

I've never messed with the private key on windows but you could probably do that instead of putting in the -pw command for your password.

Hope that gets you a little farther along...

Last edited by Blinker_Fluid; 11-02-2004 at 02:18 PM.
 
Old 11-02-2004, 02:15 PM   #3
jcspray
Member
 
Registered: Mar 2004
Location: York, UK
Distribution: Ubuntu
Posts: 132

Rep: Reputation: 15
I've had some success with winscp for scping stuff from a linux box. Note that whichever side you're initiating the connection from is the client; the other machine is the server. That means that whichever machine is connected to will need to be running the openssh daemon. My point, anyway, is that either your script will have to be on the windows box or your windows box will have to be running a ssh daemon.
 
Old 11-02-2004, 02:31 PM   #4
huibert.alblas
Member
 
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226

Rep: Reputation: 30
cygwin

AFAIK it is posible to instal sshd on cygwin (a unix enviroment for windows)
here you could use your private key, and all other linux goodies it even runs kde and gimp :-)
 
Old 11-02-2004, 03:50 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
This isi a case where experimentation will supply the best answer. You may need an active session started from the windows box. Start the ssh program from windows ( putty or ssh32 ) and leave it running. Then try the 'scp command from the Linux box. If they were linux boxes, you could have a script on Machine C that would scp a file from Machine A to Machine B. If this experiment works then this may be possible if Machine A or B were windows.
 
Old 11-03-2004, 11:13 AM   #6
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
Could even do a NFS mount to a windows share and just copy that way too...
 
Old 11-03-2004, 11:22 AM   #7
mhague
LQ Newbie
 
Registered: Nov 2004
Location: Irvine, CA
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks to all for you ideas! One of my problems is that I didn't have SSH running on the Windows box. I'm looking at a couple of the free SSH programs and I'm going to experiment. I'm also looking at trying to get the private key working to I can pull the file from Linux with no password. I had created a public key and that is probably why things didn't work.

I didn not realize there were so many options!!

Marcie
 
Old 11-03-2004, 12:03 PM   #8
shy
Member
 
Registered: Dec 2002
Location: Russia
Distribution: ASP linux
Posts: 94

Rep: Reputation: 15
Quote:
Originally posted by mhague
I'm also looking at trying to get the private key working to I can pull the file from Linux with no password.
I use putty to login from my work windows PC to the home one. Puttygen is a part of putty distribution, and can be used to create public/private keys that putty understands.
 
Old 11-03-2004, 01:56 PM   #9
mhague
LQ Newbie
 
Registered: Nov 2004
Location: Irvine, CA
Posts: 3

Original Poster
Rep: Reputation: 0
PSCP from Windows to Linux Works!

Whoo hoo! It works.

For others who may have the same problem, here are the steps I followed:

1) On the Windows box (client) Use puttygen.exe to create a public/private key.
2) Using a text editor, copy the public key that puttygen creates to a file called 'authorized_keys' (or authorized_keys2 depending on whether you are using SSH1 or SSH2).
3) Place the 'authorized_keys' file on the Linux box in the directory you need to access in the .ssh sub-directory. chmod 644 on the 'authorized_keys' file.
4) On the Windows box, using the pscp command, enter the following:

pscp -i full_path_to_private_key_file/private_key_file_name linuxuser@999.999.999.999:/full_path_to_file_to_copy destination_location_of_file
 
  


Reply



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
SCP: Copy file from remote linux server onto a windows machine? Tony Empire Linux - Newbie 21 09-22-2015 10:18 PM
SCP Copy File SSH petenyce Linux - Wireless Networking 2 10-05-2005 03:11 PM
copy files....using scp help me suguname Mandriva 2 01-26-2005 01:14 AM
copy files....using scp help me suguname Mandriva 5 01-25-2005 05:42 AM
scp copying from Linux to windows richard3403 Linux - Networking 2 11-06-2003 07:31 AM

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

All times are GMT -5. The time now is 03:59 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
Open Source Consulting | Domain Registration