Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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 :-)
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.
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.
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.
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:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.