Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy file from Windows to Linux via scp (from Linux) [closed]

Tags:

linux

unix

scp

ssh

I'm currently using scp to copy files between Linux systems.

scp username@hostname:/tmp/test.file .

Which copies my file from the remote server to the local machine.

What I would like to do is use the same scp command from my local Linux machine but copy a file from a Windows destination instead. How can this be accomplished?

like image 609
sathishkumar Avatar asked Mar 14 '23 20:03

sathishkumar


2 Answers

You can use commands available with winscp to do this on the command line.

winscp command line

This syntax is pretty close to the Linux scp command - but with Window-ish flags.

You can find the winscp.exe executable at this path:

C:\Program Files (x86)\WinSCP\winscp.exe

EDIT 01:

And if you want to use scp on the Linux machine to copy from the Windows machine, you will need to run a ssh server on the Windows box.

FreeSSHd

OpenSSH

EDIT 02:

If you cannot install a ssh server on the Windows machine, you can mount an exported directory from Windows onto Linux using the samba fs mount.

samba fs mount

like image 125
Ziffusion Avatar answered Apr 06 '23 03:04

Ziffusion


Finally found a solution

Downloaded pscp and used commandline option and then scheduled a job

c:\pscp.exe -q -batch -l mramkumar -pw xxxxx "c:\alm_testlink.png" mgr.sjc:/home/mramkumar 

Created a as bat file and scheduled as a job, This will keep pushing all the files in the folder to my linux server without prompting any password

like image 41
sathishkumar Avatar answered Apr 06 '23 04:04

sathishkumar