Jump to content

I Would Like To Transfer a CSV File From A Windows PC to CentOS 7 But Not Sure How


Recommended Posts

Posted

I have a Windows PC with a share called LinuxDump on it and I have a CSV file in it that I want to copy over to my CentOS 7 Hyper-V server.

 

I need to copy the CSV file on to my Linux server so I can import it in to my database but I've spent an hour this morning following instructions from dozens of websites and I'm not getting anywhere!

 

Clearly I'm doing something wrong as such a simple thing shouldn't be taking this amount of time so I need some help please?!

Posted

Enable SSH on your server if it hasn't been done already and then use WinSCP to transfer the file. If you can already get a putty connection to the server SSH is already enabled.

 

To enable SSH

 

To install the server and client type:

# yum -y install openssh-server openssh-clients

 

Start the service:

# chkconfig sshd on

# service sshd start

 

Make sure port 22 is opened:

# netstat -tulpn | grep :22

Posted

The websites I've been following use SAMBA or SMB and I've just twigged the reason it's not working is it must be trying to use SMB V1 by default and we all know that's not gonna work if you're on the latest version of Windows 10 due to the Spectre Metltdown vulnerabilities!

 

I'll give the SSH a go in a minute or I'll have to see if anyone knows how to force CentOS to use SMB V2 instead of V1.

Posted
Can you not just use SSH and SCP or something with an easy client like Bitvise Tunnelier?

 

Probably but I've only been using Linux for a few weeks know so what you've just said is literally a foreign language!!

 

Another vote for WinSCP, used it many times even to transfer files to ESXi hosts occasionally, i.e. drivers/firmware.

 

I'm copying and pasting the above commands at the moment and just downloaded the software so we'll see how I get on shortly!

 

Thanks all for the replies - greatly appreciated as I'm learning loads about Linux right now on a very sharp learning curve :)

Posted
Enable SSH on your server if it hasn't been done already and then use WinSCP to transfer the file. If you can already get a putty connection to the server SSH is already enabled.

 

To enable SSH

 

To install the server and client type:

# yum -y install openssh-server openssh-clients

 

Start the service:

# chkconfig sshd on

# service sshd start

 

Make sure port 22 is opened:

# netstat -tulpn | grep :22

 

Thank you so much for that! Everything is easy when you know how, and now I know this, file transfers to and from Linux are now easy! :)

Posted
Thank you so much for that! Everything is easy when you know how, and now I know this, file transfers to and from Linux are now easy! :)

 

Glad my post helps and I couldn't agree with you more!

  • Thanks 1
Posted
mail.

 

so to send a file you would use

mail -s subject [email protected] < yourfilename.txt

Sorry that would be how you would send email. Anyway it's a bit off-topic if you don't need to setup a mail server. Stick to ssh - and setup keys so you don't need ot login every time.

Posted
I have a Windows PC with a share called LinuxDump on it and I have a CSV file in it that I want to copy over to my CentOS 7 Hyper-V server.

 

As a one-off operation or on a schedule? Once you've got SSH access to your server you could just copy-and-paste the text from the CSV file open in Windows directly to a text editor open on the terminal.

  • 3 months later...
Posted
If your familiar with scp in Linux then I drop PSCP.exe from the putty website into my windows directory cause it works the same as scp does in Linux term... but in cmd :)
Posted
If your familiar with scp in Linux then I drop PSCP.exe from the putty website into my windows directory cause it works the same as scp does in Linux term... but in cmd :)

OpenSSH is included with Windows 10 now (since v1709). No need for PuTTY or even WSL. :)

 

IaAWO4.png

  • Thanks 3
Posted
OpenSSH is included with Windows 10 now (since v1709). No need for PuTTY or even WSL. :)

 

It's laughable how ssh has been on mac,linux and other unixes for the last 20 years. I always thought it was down to the licensing which meant microsoft couldn't put it into windows given how useful ssh is !

I guess they are focusing on developers a bit more now, but does anyone have any ideas why they neglected this for so long ?

Posted
I guess they are focusing on developers a bit more now, but does anyone have any ideas why they neglected this for so long?

It may have something to do with the previous CEO...

 

www.theregister.co.uk/2001/06/02/ballmer_linux_is_a_cancer

www.zdnet.com/article/ballmer-i-may-have-called-linux-a-cancer-but-now-i-love-it/

 

It's laughable how ssh has been on mac, linux and other unixes for the last 20 years.

Better late than never!

Posted (edited)
Never knew that!

I guess they are focusing on developers a bit more now

Wow I didn’t know that but I run server on my workstation but when 2019 is out happy days

I think the eventual aim is to replace WinRM with SSH for PowerShell Remoting to enable you to run commands remotely regardless of whether you are using Windows, macOS or Linux.

 

Since build 17063, Microsoft have also added Curl and Tar to make it easier for developers to work with containers (although that's not all you can use them for).

 

v5dlh4.png

 

kiDbbF.png

Edited by Arthur

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...