LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Transfer files from Linux to Windows pscp (https://www.linuxquestions.org/questions/linux-newbie-8/transfer-files-from-linux-to-windows-pscp-4175530524/)

vrecalde 01-09-2015 07:07 AM

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?

vrecalde 01-09-2015 07:50 AM

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.

michaelk 01-09-2015 08:03 AM

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.

allend 01-09-2015 08:05 AM

From your Windows command line, the syntax is
Code:

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

vrecalde 01-09-2015 08:45 AM

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.

schneidz 01-09-2015 08:53 AM

since this is a windows question it should probably in the general(non-*nix) subforum.
does windows have a cron daemon ?

allend 01-09-2015 08:57 AM

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.

cepheus11 01-09-2015 08:58 AM

Quote:

Originally Posted by vrecalde (Post 5298191)
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.

michaelk 01-09-2015 09:01 AM

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.

vrecalde 01-09-2015 10:36 AM

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.

Doug G 01-09-2015 05:26 PM

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.


All times are GMT -5. The time now is 03:37 AM.