User:Sakaki/Sakaki's EFI Install Guide/Setting Up Networking and Connecting via ssh

Having successfully booted our target PC with the Gentoo minimal install image, our next task is to establish network connectivity for it.

Once that is done, we'll connect in remotely to the target, from the helper PC, via ssh. This will make subsequent installation steps (such as the copy/paste of lengthy commands) much easier.

This section shadows Chapter 3 of the Gentoo handbook.

Getting Networking Running
Decide whether you wish to perform the install using a wired Ethernet connection, or over WiFi (using WPA/WPA2), and follow the appropriate instructions below. In both cases, the presence of a DHCP server on the subnet will be assumed.

Connecting via Wired Ethernet
This is the easier option, if your machine physically supports it. To proceed, plug an ethernet cable into the target machine now, and hook it up to your network (into the back of your cable or ADSL router etc.). Wait for a minute or so (for DHCP to allocate you an address), then (at the keyboard of your target PC) enter:

Hopefully, it will have autoconfigured an interface, as above. In the old days, you'd be looking for eth0 in the output of this command, but things have now changed (to ensure device naming stability across reboots), so your wired ethernet interface name will probably be something a bit stranger-sounding, such as enp0s25 (as is the case here). You are looking for the 'inet' (assuming IPv4) entry; in this case 192.168.1.106 (yours will almost certainly differ).

If that was successful, then try:

This should return your public IP address, thereby demonstrating that you have a functional IP connection. It may take a little while to complete, so please be patient.

When ready, click here to jump to the next section of the tutorial.

Connecting via WiFi (WPA/WPA2)
If your PC has no Ethernet port, you'll have to perform the installation over WiFi. First, check that your PC's adaptor has driver support in the minimal-install image. Issue:

Your results will differ from the above, but you're looking for a record starting with wl, as this is a wireless adaptor. In this example, the predictable network interface name of the WiFi adaptor is wlp2s0; take a note of the particular name reported in your case.

Next, we'll need to create a configuration file, to allow the wpa_supplicant program to handle the encrypted network connection. You'll need to know your WiFi access point's ESSID (the name you'd see when connecting to it via your phone etc.) and its WPA (or WPA2) passphrase. Issue:

Lock down the file's access permissions (to root only) and check that its contents look sane. Issue:

Assuming that looks OK, we can connect. Issue:

In this command:

Now wait a moment or two, then issue:

Hopefully, it will have connected successfully. You are looking for the 'inet' (assuming IPv4) entry; in this case 192.168.1.106 (yours will almost certainly differ).

If that was successful, then try:

This should return your public IP address, thereby demonstrating that you have a functional IP connection. It may take a little while to complete, so please be patient.

<span id="setup_ssh_server">Connecting via ssh</tt> and Using screen</tt>
Our next step is to setup ssh</tt> so we can remotely connect and run the install from our helper PC. Still on the target machine console, enter:

Now take note of the RSA and ED25519 fingerprints for the host (which one is used when you try to connect, will depend upon the settings and recency of the system in your helper PC):

Next, <span id="log_in_via_helper">move back onto the second, helper PC (on the same subnet), and enter:

(The sed</tt> command simply removes any record of fingerprints for previous connections to other sshd</tt> servers at that IP address, since ssh</tt> will refuse to connect if it finds a conflicting one.)

Check the reported key fingerprint and then, if it matches one you noted earlier, continue as below:

You should find that you can continue configuring remotely, which is much more convenient (as you will have a full windowing environment with graphical web browser, copy and paste, and so on).

Now, still via this remote login ssh</tt> connection (i.e., at the helper PC's keyboard), <span id="start_screen">issue :

to start a new screen session - this is useful as it allows you to multiplex several virtual consoles, disconnect while lengthy compiles are running and then reconnect later, and so on.

<span id="next_steps">Next Steps
Next, we'll prepare the storage on the target machine. Click here to go to the next chapter, "Preparing the LUKS-LVM Filesystem and Boot USB Key".

Acknowledgements
We would like to thank the following authors and editors for their contributions to this guide: