LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-11-2016, 12:44 AM   #1
SSR
LQ Newbie
 
Registered: Mar 2016
Posts: 2

Rep: Reputation: Disabled
How to copy a file from my linux machine to remote window machine


I am able to copy the file from window machine to linux machine via pscp but i wanted to know is there any command by which i can copy the file from linux machine to windows machine.
Please help if anyone know about the same.
Thanks in Advance.
 
Old 03-11-2016, 12:57 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
it depends on what is installed on windows. If you have shared a directory (and C$, D$ usually available) you can mount it on your linux and a simple copy should do the job.
 
Old 03-11-2016, 01:03 AM   #3
SSR
LQ Newbie
 
Registered: Mar 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks pan64 for your rply .
So I cant use SCP to copy the file from linux server to window server ??Can you share me the steps how can i share the directory of window server and mount it to the linux server .
NOTE: both linux and window server are remote .
 
Old 03-11-2016, 02:02 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you can use scp if an scp server was installed on the windows side. I do not know anything about that. I suggest you to check:
http://www.cri.ch/linux/docs/sk0001.html
http://www.howtogeek.com/168115/moun...ux-with-samba/
 
Old 03-11-2016, 10:04 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
I think that the best general approach is to "bloom where you are planted." In other words, connect to the remote system using standard network file-sharing in a manner most-well supported by that host. Linux, Samba, etc. makes it easy to connect to a Windows shared network, and to participate fully in such a network as a true peer. Thus, you simply mount the share (logging-in to the Windows network unless it automagically recognizes you), and copy the files to-and-fro as you see fit. Exactly as you would do if you weren't (ick ...) using Linux.
 
Old 03-15-2016, 02:40 AM   #6
edenCC
Member
 
Registered: May 2006
Location: China
Distribution: Debian
Posts: 198
Blog Entries: 1

Rep: Reputation: 32
I'd use shttpd to run a tiny web server on Linux, then use windows to download from it.
 
Old 03-15-2016, 11:16 AM   #7
fmattheus
Member
 
Registered: Nov 2015
Posts: 104

Rep: Reputation: 38
He doesn't need to run a webserver on linux. Linux already has ssh running. He already knows how to use pscp to copy files from windows to linux. He just needs to learn how to use pscp to pull files from linux to windows.

Instead of calling it like this
Code:
pscp sourcefile user@host:targetdir
call it like this
Code:
pscp user@host:sourcedir/file targetfile
 
Old 03-15-2016, 09:30 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Most Linux distros come with Samba client installed. Check your distro to find out whether it does. You do not need Samba server for what I will describe below.
  1. Share a Windows directory in the Windows directories property dialog. Be sure to use simple sharing. Do not use Windows homegroup sharing; it works only with other Windows devices. Preferably the directory should be within your C:/users/[username] directory.
  2. Put the file into that shared directory on the Windows machine.
  3. Open the file manager on the Linux machine and browse to the shared directory on your Windows machine. If your file manager does not discover the directory, you can enter the Windows machine into the address bar of your file manager, like this
    Code:
    smb://[ip address of Windows machine]
  4. Find the file and copy and paste it to the target directory on your Linux machine.

If you run into any problems, post them to this thread, including any error messages you get.
 
Old 03-15-2016, 09:55 PM   #9
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
If you're initiating the transfer from the windows computer, winscp works very well.
 
Old 03-18-2016, 08:53 AM   #10
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
The "putty" package on the Windows side is a good, reliable client. Yes, they prefixed the letter "p" to all of their command-names, which is actually rather annoying, but otherwise it's directly on-par with the Linux equivalents. Their SSH-agent is called "pagent." (Or is it the English word, "pageant?" I don't recall.) Anyhow, everything you need to do SSH from the Windows world, and I believe also to provide an SSH daemon on Windows, is all there.
 
Old 03-18-2016, 06:41 PM   #11
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
If you can access the remote Windows machine using RDP, then you can use the '-r disk:' option to rdesktop (a Linux RDP client) to have a directory on your Linux machine appear in the Windows file manager.
 
Old 03-21-2016, 05:21 AM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I'm with fmattheus; just do pscp pull instead of a push; no need to use another tool or setup file sharing.
 
  


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
how to control window xp machine from linux machine thro wired network pemravi007rediff Linux - Networking 1 06-13-2012 03:21 AM
file transfer from remote window machine perky.nishi Linux - Newbie 1 06-24-2008 06:29 AM
scp: copy a file from local machine to remote machine seran Linux - Newbie 8 10-30-2007 12:23 PM
i can't browse my linux machine from windows machine's network neighbourhood window yagneshmistry Linux - Networking 2 08-10-2004 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:48 PM.

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