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.

3
  • have you tried ssh?
    – TPS
    May 2 '14 at 9:16
  • @Tejas: I think you meant sftp or scp.
    – Ouki
    May 2 '14 at 9:16
  • Indeed scp....@Ouki
    – TPS
    May 2 '14 at 9:18
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/
1
  • Ubuntu desktop says ssh_exchange_identification: read: Connection reset by peer lost connection
    – Corleone
    May 4 '14 at 12:23
1

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

4
  • rsync requires that a rsync server is installed on one of the servers.
    – Ouki
    May 2 '14 at 9:19
  • rsync requires indeed that it is installed on both hosts. However rsync can make use the SSH connection for the transfer.
    – Spack
    May 2 '14 at 9: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. May 2 '14 at 9:21
  • @Spack & Tero Kilkanen: thanks. I always used rsyncd by the past
    – Ouki
    May 2 '14 at 9: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
1
  • 1
    While this might work - I think it's doing it the hard way. May 2 '14 at 10:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.