Link to home
Start Free TrialLog in
Avatar of gumball60
gumball60Flag for United States of America

asked on

Copy files from Windows to Linux

I am using Cygwin.  What are the best commands to copy files from a windows client to a Red Hat client using Cygwin.
Avatar of tmx84
tmx84
Flag of United States of America image

SSH? SCP? Samba?

Which way are you trying to connect?  Connecting from Linux to Windows or vice versa?  If they are on the same workgroup/domain, you could setup a Samba Client and just share the files on Windows... There are lots of ways to do it, but you have to connect the two PC's before you can just send commands... Or even setup a Samba server and just create a share folder that you connect to from windows and copy the files over via file share..

Cygwin isn't really going to help you so to speak unless you are trying to setup an SSHD on the windows machine rather then the Linux Machine...
Avatar of gumball60

ASKER

I am connecting from windows to linux.  Both Windows and Red Hat are in the same domain.
Samba is installed
I have used Samba to connect Windows and Linux. It takes some learning and some setup, but it does work.

Is this an ongoing thing?  Then Samba. Or is this one time? Then consider just using a USB key. That is easy and should work.

.... Thinkpads_User
So Samba is currently installed on the Linux Machine?  If so, Share out a folder on Windows, make sure you set the security settings correctly.  Go over to your Linux machine, not sure if it's CLI or GUI, if it's GUI, go to Files, Click on Connect to Server, you will type in smb://XXX  XXX being Ip address of Windows machine.  Click connect, should give you a credential screen, type in the correct credentials and you should have access to the folder share...

Or you could do the reverse, and share out a folder on the linux machine and connect to it from the windows machine (you will not need cygwin for this).  

Here is a link how to share a directory in Red Hat...

https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-Samba-Configuration_examples.html#sect-Managing_Confined_Services-Configuration_examples-Sharing_directories_you_create
Avatar of Gerwin Jansen
Basic and simple: using (s)ftp.

Connect from cygwin to Linux:  (s)ftp <linux_host>
(enter username and password)

put (or mput) your files to the Linux host.
Regular plain FTP will convert the line endings if you transfer files in ASCII mode.... this is handy if you are moving text files but otherwise you'll want to be sure to do the transfer in Binary mode so the files don't get horked.
To set binary mode in FTP, type: bin on the FTP prompt...
ASKER CERTIFIED SOLUTION
Avatar of serialband
serialband
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial