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.

  • have you tried ssh?
    – TPS
    Commented May 2, 2014 at 9:16
  • @Tejas: I think you meant sftp or scp.
    – Ouki
    Commented May 2, 2014 at 9:16
  • Indeed scp....@Ouki
    – TPS
    Commented May 2, 2014 at 9:18

3 Answers 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 [email protected]:/target/directory/
  • Ubuntu desktop says ssh_exchange_identification: read: Connection reset by peer lost connection
    – Corleone
    Commented May 4, 2014 at 12:23

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

  • rsync requires that a rsync server is installed on one of the servers.
    – Ouki
    Commented May 2, 2014 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
    Commented May 2, 2014 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. Commented May 2, 2014 at 9:21
  • @Spack & Tero Kilkanen: thanks. I always used rsyncd by the past
    – Ouki
    Commented May 2, 2014 at 9:27

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
    While this might work - I think it's doing it the hard way. Commented May 2, 2014 at 10:31

Not the answer you're looking for? Browse other questions tagged .