How do I connect using ssh over a direct Ethernet connection?

21,543

To establish basic network connectivity between two computers, it's much easier to connect computers using a SOHO network switch (something equivalent to, say, a Linksys SE1500) and then assign static IP addresses to each host. This is a more flexible and robust configuration than a direct link. Definitely worth the ~40 bucks.

If direct link is the only option, http://ubuntuforums.org/showthread.php?t=1543087 has details. The use of a cross-over cable may not be a hard requirement if both computers support Auto-MDIX.

The SSH wiki page should tell you what you need to get SSH running on your desktop. Once you've got a SSH connection established, you can just copy the required files to a known location like your home directory with cp. Example:

cp /var/log/Xorg.0.log ~/
Share:
21,543

Related videos on Youtube

Knowledge Cube
Author by

Knowledge Cube

Updated on September 18, 2022

Comments

  • Knowledge Cube
    Knowledge Cube over 1 year

    I have a laptop, a desktop, and a spare 5' Ethernet cable that I can use to directly connect one to the other. The desktop freezes every few days or so, seemingly at random, and when it happens I want to be able to ssh into it as mentioned here so I can make a proper bug report and get this fixed.

    Unfortunately, the linked guide doesn't give any instructions on how to do this. Can someone provide a step-by-step answer on how to ssh from my laptop into my desktop when the latter freezes, and also how to conveniently retrieve the necessary files once logged in to attach to the bug report?

    A couple things to keep in mind:

    • I'm using standard desktop Ubuntu installs on both systems. If there's any extra packages I need installed beforehand, let me know.
    • My machines each have only a single Ethernet port; the desktop uses this for its wired-only Internet connection, and my laptop on the other hand uses an 802.11n WiFi connection. Only one machine can use the wired connection at a time due to network restrictions in my dorm, and the wireless connection my laptop uses is very unreliable. Thus, answers should preferably not depend on a working Internet connection, but rather a direct connection between the two machines, if that's possible.
    • I've never logged into one of my own machines from another of my own before, so assume I know nothing and be sure to provide plenty of details. :)
  • Knowledge Cube
    Knowledge Cube about 12 years
    Sorry, I haven't been able to get around to this until today. I am unable to connect using that guide...when I hook up the two machines via my Ethernet cable, they try but fail to establish a wired connection, and as such I can't attempt to ssh from the laptop into the desktop. Can you edit your answer with the exact steps needed in order to get this working so it's more helpful? Thanks.
  • colan
    colan over 10 years
    The quick solution with Network Manager is explained better as a recipe over at How to Set Up Ubuntu With a Crossover Cable.