Find the answer to your Linux question:
Results 1 to 5 of 5
I am setting up a new computer, and wish to copy about 100 GB of data from my old computer. I have cat 5 cable, a cross over ethernet cable, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer MASONTX's Avatar
    Join Date
    May 2010
    Location
    Mason Texas
    Posts
    929

    How to connect 2 computers in linux.


    I am setting up a new computer, and wish to copy about 100 GB of data from my old computer. I have cat 5 cable, a cross over ethernet cable, and a cross over usb cable, and have ubuntu 10.04 on the old computer and Lubuntu 12.04 on the new computer. When I connect using either of the cross over cables, the computers do not see each other. What do I need to enable to be able to copy data from the old computer to the new one? I googled, but all the answers either pertained to windows, or just said to use linux, not how. Thanks for the help, I know it must be simple, but I'm not seeing it.
    Registered Linux user #526930

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    put both machines on the same local IP subnet, e.g.:

    pc1: ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

    pc2: ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up

    then connect them with the x-over cable. if you have a hub/switch, you could use that inb/t them, too. you might even be able to use the cat5 cable if the NICs are auto-switching, but don't rely on that. stick with either x/o or hub/switch.
    then see if you can ping.

    you don't need a default route.

    make sure the link lights are on for both NICs. if you have ethtool, you can check if a link is detected, e.g.:

    Code:
    ethtool eth0|grep -i link
    if you have firewalls on, you might want to turn them off.

    then start up sshd, and you can use scp/sftp.

    or use an FTP server like vsftpd.

  3. #3
    Linux Engineer MASONTX's Avatar
    Join Date
    May 2010
    Location
    Mason Texas
    Posts
    929
    Quote Originally Posted by atreyu View Post
    put both machines on the same local IP subnet, e.g.:

    pc1: ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

    pc2: ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up
    I do this in the internet connection set up, right?

    then connect them with the x-over cable. if you have a hub/switch, you could use that inb/t them, too. you might even be able to use the cat5 cable if the NICs are auto-switching, but don't rely on that. stick with either x/o or hub/switch.
    then see if you can ping.
    Does it matter which computer I ping from? And would that be from the command line, ping -r -I 255.255.255.0 ? or just ping since you said

    you don't need a default route.


    then start up sshd, and you can use scp/sftp.

    or use an FTP server like vsftpd.
    Would this be sudo service ssh start on the ubuntu machine (the ones with the files I want to transer) then sudo service ssh stop when I was done? Do I just need to do that on the one machine, or do I need to do it on both?


    Thanks for the help, I really appreciate it.
    Registered Linux user #526930

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by MASONTX View Post
    I do this in the internet connection set up, right?
    sorry, i was thinking in the terminal. you don't need to do it in the gui, but you could. i would just open a terminal, and do the ifconfig commands- using sudo too, forgot it is *buntu, e.g.:

    Code:
    sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up
    that assumes your ethernet device is eth0, btw.

    Does it matter which computer I ping from? And would that be from the command line, ping -r -I 255.255.255.0 ? or just ping since you said
    ping the ip address of one pc from the other, e.g.:
    Code:
    # from pc1, ping pc2's ip address
    ping 192.168.1.2
    
    # from pc2, ping pc1's ip address
    ping 192.168.1.1
    Would this be sudo service ssh start on the ubuntu machine (the ones with the files I want to transer) then sudo service ssh stop when I was done?
    you got it.
    Do I just need to do that on the one machine, or do I need to do it on both?
    yeah, you only need to start the service on the machine to which you will be connecting. it doesn't matter which side your files to copy reside on, b/c you can go either way. here's a couple examples:
    Code:
    # from pc1, pull file residing on pc2 to pc1
    [root@pc1 ~]# scp root@192.168.1.2:/path/to/file.zip .
    
    # from pc2, push file residing on pc2 to pc1
    [root@pc2 ~]# scp /path/to/file.zip root@192.168.1.1:/tmp
    Thanks for the help, I really appreciate it.
    np

  5. #5
    Linux Engineer MASONTX's Avatar
    Join Date
    May 2010
    Location
    Mason Texas
    Posts
    929
    Thanks atreyu. That cleared up my confusion. I'm at work now, but will try it when I get home tomorrow.
    Registered Linux user #526930

Posting Permissions

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