0

How do I transfer data between Ubuntu and CentOS using LAN cable, in the same network? I tried installing Samba which did not go well in CentOS.

Mat
  • 52,586
Corleone
  • 152

3 Answers3

3

The easiest would be to set up SSH and use SCP. If you are transferring files to the CentOS server, do the following:

On CentOS:

sudo yum -y install openssh-server openssh-clients
sudo chkconfig sshd on
sudo service sshd start

From the Ubuntu box, run:

scp sourcefile.txt username@ip.of.centos:/target/directory/
mtak
  • 1,294
1

If you have an SSH server installed on both of them, you can use scp or better make use of rsync.

Spack
  • 1,997
  • rsync requires that a rsync server is installed on one of the servers. – Ouki May 02 '14 at 09:19
  • rsync requires indeed that it is installed on both hosts. However rsync can make use the SSH connection for the transfer. – Spack May 02 '14 at 09:20
  • 2
    rsync does not require using rsync server. Only the normal rsync client is enough. rsync -e ssh source username@destination:path is the syntax for RSync over SSH. – Tero Kilkanen May 02 '14 at 09:21
  • @Spack & Tero Kilkanen: thanks. I always used rsyncd by the past – Ouki May 02 '14 at 09:27
1

Open a shell on the destination host and type:

~# nc -v -v -l -n -p 2222 > file.out

Now open a shell on you sender host and type the following commands:

~# pv -t -r -a -b /dev/zero | nc -v -v -n DESTINATION_IP_HERE 2222 < file.in
Matt
  • 111