Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43

Thread: Is there a step-by-step guide to transfer files between two Linux computers?

  1. #1
    Join Date
    Aug 2016
    Beans
    66

    Is there a step-by-step guide to transfer files between two Linux computers?

    Hi,

    I have two Linux computers - one is running Mint 18.3; the other one is running Ubuntu 16.04 LTS.

    Can someone provide a very detailed guide to transfer files between them via a typical Ethernet cable, if possible?

    I believe I need to connect the two computers with the ethernet cable and then set up static IP addresses on both computers. Then I can some software (such as NitroShare) to select and transfer?

    If such operation is indeed possible, I would really appreciate it if someone can explain the step-by-step procedural to me like I am a 4 year-old. Thanks!

  2. #2
    Join Date
    Apr 2014
    Beans
    841

    Re: Is there a step-by-step guide to transfer files between two Linux computers?

    If they are on the same network you only need the ip address of the target, then just use either scp or rsync on the command line.

  3. #3
    Join Date
    Aug 2016
    Beans
    66

    Re: Is there a step-by-step guide to transfer files between two Linux computers?

    Quote Originally Posted by Tadaen_Sylvermane View Post
    If they are on the same network you only need the ip address of the target, then just use either scp or rsync on the command line.
    Hi, thank you. I believe what I want to do is feasible. But I would need a much more thorough explanation to perform the steps. Could you provide those when you have time?

  4. #4
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,470

    Re: Is there a step-by-step guide to transfer files between two Linux computers?

    OK, I can try to explain it:

    First, you need a cable and you need to disable NetworkDamager, since it will automatically bugger things up for you
    On A and B:
    $ sudo killall NetworkManager
    $ sudo killall dhclient
    Now connect an ethernet cable between two computers A and B.

    On A:
    Configure ethernet port with one address
    $ sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

    On B:
    Configure ethernet port with another address
    $ sudo ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up

    On A:
    Tell netcat to listen on port 1234 and save the incoming file
    $ sudo nc -l -p 1234 > filename

    On B:
    Tell netcat to send the file to the other computer IP address and port number
    $ sudo nc 192.168.1.1 1234 < filename

    La voila!
    Last edited by HermanAB; March 24th, 2018 at 12:01 PM.

  5. #5
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    15,642
    Distro
    Kubuntu Development Release

    Re: Is there a step-by-step guide to transfer files between two Linux computers?

    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  6. #6
    Join Date
    Dec 2009
    Beans
    6,577

    Re: Is there a step-by-step guide to transfer files between two Linux computers?

    Can someone provide a very detailed guide to transfer files between them via a typical Ethernet cable, if possible?

    I believe I need to connect the two computers with the ethernet cable and then set up static IP addresses on both computers. Then I can some software (such as NitroShare) to select and transfer?
    Are you talking about a direct connection between these two machines or is a router involved?

    It's been way too long for me to remember how to do a direct connect but I think it matters in the responses you get.

  7. #7
    Join Date
    Apr 2014
    Beans
    841

    Re: Is there a step-by-step guide to transfer files between two Linux computers?

    scp and rsync work the same way. this is the basic format

    I use -auv for most things on my rsync scripts and such.
    Code:
    rsync -auv --progress /file/or/folder/to/transfer $USER@ip.address:/path/to/put/file/or/folder
    or scp

    Code:
    scp -r /file/or/folder/to/transfer $USER@ip.address:/path/to/put/file/or/folder

  8. #8
    Join Date
    Aug 2016
    Beans
    66

    Re: Is there a step-by-step guide to transfer files between two Linux computers?

    Quote Originally Posted by Morbius1 View Post
    Are you talking about a direct connection between these two machines or is a router involved?

    It's been way too long for me to remember how to do a direct connect but I think it matters in the responses you get.
    I would like to connect the two machines with just a typical Ethernet cable. No router. Thanks.

  9. #9
    Join Date
    Aug 2016
    Beans
    66

    Re: Is there a step-by-step guide to transfer files between two Linux computers?

    Quote Originally Posted by HermanAB View Post
    OK, I can try to explain it:

    First, you need a cable and you need to disable NetworkDamager, since it will automatically bugger things up for you
    On A and B:
    $ sudo killall NetworkManager
    $ sudo killall dhclient
    Now connect an ethernet cable between two computers A and B.

    On A:
    Configure ethernet port with one address
    $ sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

    On B:
    Configure ethernet port with another address
    $ sudo ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up

    On A:
    Tell netcat to listen on port 1234 and save the incoming file
    $ sudo nc -l -p 1234 > filename

    On B:
    Tell netcat to send the file to the other computer IP address and port number
    $ sudo nc 192.168.1.1 1234 < filename

    La voila!
    Thanks. I have a question though. If I "kill" the NetworkManager, do I need to re-enable it after I am done? How?

    Once it's connected, do you recommend to use NitroShare or any program? I may want to share a whole folder as opposed to one or two files individually.

  10. #10
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,470

    Re: Is there a step-by-step guide to transfer files between two Linux computers?

    If you kill NetworkManager, then you got to restart it again later with:
    $ sudo systemctl restart networking.service

    Once connected, you can start the sshd service or a FTP server or whatever you want. There are umpteen ways to share files.

    You can even make a tar ball and transfer it with netcat.

Page 1 of 5 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •