Crossover Cable File Sharing

From FreekiWiki
Jump to navigation Jump to search

You don't need the internet, a LAN, or even a router to have two computers talk to one another. All you actually need is a cable and a protocol. In this tutorial, we're going to cover having two systems directly connect to one another with a Crossover Cable and how to implement filesharing between them using Linux.

Preliminaries

First we're going to need to procure a cable capable of full-duplex communication. This can be an ethernet cable designated as either Category 5E or Category 6. Note that if you're ethernet cable is Category 5, you will not be able to establish a direct connection with the other system unless it is wired to be a Crossover Cable! Usually, ethernet cables will have which category it's designated as printed somewhere along the length of its housing. If nothing else, all of the ethernet bundles in the Thrift Store are Cat 5E or Cat 6 and are quite cheap.

Secondly, we're going to have to install some software than can utilize an application protocol that both machines can understand. Here we'll go over using FTP and SSH with the rssh and sshfs packages, and few different methods for implementing those protocols.

Finally, it is assumed you are using a graphical distro that utilizes Network Manager (e.g., Ubuntu). Documentation for configuring your systems without the fetters of Network Manager may yet one day exist. You will need to have a user account and password on each of the systems you intend to connect.

Step 1 -- Configuring the first System

  1. Connect your two systems with the crossover cable (literally, from one RJ-45 jack to the other).
  2. On the first system, click the Network Manager icon and then Edit Connections. Select Add Connection.
    • Under the IPv4 Settings tab, choose Method: Manual.
    • Under Addresses, select Add.
    • Enter the following for each of the fields:
      • Address: 10.4.4.1
      • Netmask: 255.0.0.0
      • Gateway: 10.4.4.2
    • Select Save.

Step 2 -- Configuring the second System

  1. Similarly to Step 1, click the Network Manager icon and then Edit Connections. Select Add Connection.
    • Under the IPv4 Settings tab, choose Method: Manual.
    • Under Addresses, select Add.
    • Enter the following for each of the fields:
      • Address: 10.4.4.2
      • Netmask: 255.0.0.0
      • Gateway: 10.4.4.1
    • Select Save.

Note: The only difference here is swapping the Address and Gateway fields. In essence, we are telling each of the systems to look to the other for other systems (and networks, potentially, but that is beyond the scope of this tutorial).

Step 3 -- Communicating

  1. On the first system, install the rssh package (sudo apt-get install rssh on Debian-based distros)
    • NOTE: If you're using Debian or a Debian-based distro, openssh and ftp should be installed by default (actually, I can't think of a distro that doesn't have these installed by default).
  2. Confirm the sshd daemon is running (pgrep -l sshd).
    • If not, run the following: sudo service sshd start
  3. We are now going to attempt to connect the systems. On the second system:
    • If you are using Gnome2, or some variant, go to Places -> Connect to Server,
    • If you are using Gnome3 or Unity, open nautilus (Win+Key, nautilus), and go to File -> Connect to Server
    • Under Server Details, enter the following:
      • Server: 10.4.4.1
      • Type: SSH
      • User name: $USERNAME
      • Password: $PASSWORD
    • Select Connect.
  4. You should now have access to the other machine through your graphical file manager (Nautilus). Copy and paste items between the systems to your heart's content!

Bonus -- GUI-less configuration

To be continued...