LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-09-2015, 07:07 AM   #1
vrecalde
LQ Newbie
 
Registered: Dec 2014
Posts: 8

Rep: Reputation: Disabled
Exclamation Transfer files from Linux to Windows pscp


Hi, i am newbie. I have problems to transfer files between Linux to Windows. Here goes mi situation.

I have already install pscp in windows, i tested it typing pscp in command line, its ok. I have read that pscp is primordial to perform the transfers.

The problem is the next: i am located in /root, trying to transfer install.log to c:\temp, doing the next: pscp.exe root@192.168.x.x: /root/install.log c:\temp
and the result is:
-bash: pscp.exe: command not found

I am searching in the internet for a solution but with no success yet. Could you help me please?
 
Old 01-09-2015, 07:50 AM   #2
vrecalde
LQ Newbie
 
Registered: Dec 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
I have some advance on this. Type the next: (replace pscp for scp)

scp root@192.168.xxx.xxx:/root/install.log c:\temp

but the problem has change:

root@192.168.xx.xx's password:
ssh: Could not resolve hostname c: Name or service not known
lost connection
Connection to 192.168.xx.xx closed.

Im working on the solution, i will post here when i find it. If anyone had this problem i will be apreciate it if share the solution.
 
Old 01-09-2015, 08:03 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
You can not transfer from linux to windows using scp without a ssh server running on the windows computer. You need to transfer the install.log using a client on the windows computer. There are windows GUI sftp clients like filezilla and winscp that are easier to use then pscp.
 
2 members found this post helpful.
Old 01-09-2015, 08:05 AM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
From your Windows command line, the syntax is
Code:
pscp root@192.168.xxx.xxx:/root/install.log c:\temp\install.log
 
1 members found this post helpful.
Old 01-09-2015, 08:45 AM   #5
vrecalde
LQ Newbie
 
Registered: Dec 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
Ok. In consecuence, i downloaded freeSSHd.exe from http://www.freesshd.com/?ctt=download, i put it run, i repeat the action:

scp root@192.168.xxx.xxx:/root/install.log c:\temp

same error.

I dont use WinScp couse this is a test. The objective is transfer many files from a directory of Linux to a dir on Windows. This will be automated in crontab every minute.

Allend, i have tried your solution, its works. I apreciate both information.

Ok, now this has to be automated, i will invstigate how works it in windows, i imagine i can use programming tasks.

Other problem, when i submit the command line supplied for allend, it asked me for a password, i will try to fix it with Puttygen, i hope.

Any ideas will be grateful.
 
Old 01-09-2015, 08:53 AM   #6
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
since this is a windows question it should probably in the general(non-*nix) subforum.
does windows have a cron daemon ?
 
Old 01-09-2015, 08:57 AM   #7
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Quote:
now this has to be automated
If you are generating files on the Linux server that you want to be available to Windows, it might be better to create a shared directory on the Windows machine that can then be mounted on the Linux server.
 
1 members found this post helpful.
Old 01-09-2015, 08:58 AM   #8
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 286

Rep: Reputation: 91
Quote:
Originally Posted by vrecalde View Post
transfer many files from a directory of Linux to a dir on Windows. This will be automated in crontab every minute.
Ever thought of doing this from windows, with windows's task scheduler? Advantages:
  • Running an SSH server on linux is better supported than on windows
  • Your server only needs to expose the files readonly to the network, not read-write.
 
1 members found this post helpful.
Old 01-09-2015, 09:01 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Here are a couple of ideas.

You can also use samba (SMB/CIFS) to transfer files to a windows share.

You can automate the task using windows scheduler to run a batch file that contains the pscp command.
 
1 members found this post helpful.
Old 01-09-2015, 10:36 AM   #10
vrecalde
LQ Newbie
 
Registered: Dec 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
schneidz, originally i wanted to transfer files automatically from linux to windows, using cron, but, allend show me how to do it from command line of windows (pscp root@192.168.xxx.xxx:/root/install.log c:\temp\install.log), so, this problem has become a windows problem cause now i have to automate from windows side.

Thanks partners, i will be hovering this forum frequently.
 
Old 01-09-2015, 05:26 PM   #11
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
This just worked fine for me on windows 7 computer connecting to a fedora 20 computer. There is no sshd server on windows, it's not necessary to have one to use pscp from windows. You'd only need a sshd server if you want to initiate a ssh connection from the linux machine to the windows machine.

Code:
 C:\Program Files (x86)\PuTTY>pscp <linuxuser>@lc140.dvl.local:/home/linuxuser/aaa/video/howto.txt c:\aaa
EDIT: I missed some of the recent posts that already answered this. Sorry.

Last edited by Doug G; 01-09-2015 at 05:28 PM.
 
  


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
[SOLVED] How to copy the files from linux box to windows (using PSCP or other utility) akhand jyoti Linux - Newbie 1 12-12-2011 05:56 AM
[SOLVED] How to transfer(copy) files from Linux to windows? glock356 Linux - General 9 08-25-2011 02:54 AM
transfer files between windows and linux guixingyi Linux - Networking 7 01-23-2011 12:15 PM
Transfer of files between (to/from) Linux and windows hill0093 Linux - Newbie 6 01-11-2011 01:50 AM
How to transfer files from Linux to Windows SentralOrigin Linux - General 7 10-31-2005 04:29 PM

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

All times are GMT -5. The time now is 01:37 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