Remote Login

In this section we'll connect to our new headless Debian server using the Secure Shell (SSH) protocol. From this point on, you won't need a monitor or keyboard connected to the Debian server. All administration will be done remotely from another computer on your local network.

On a Mac or Linux computer, open the Terminal application. On Windows, open PowerShell.

You'll need the IP address that you wrote down before disconnecting the monitor from the Debian server.

Connect to the server using the following command, replacing ipaddress with your server's IP address:

ssh nelson@<ipaddress-from-previous-section>

The first time you connect, you may be asked to confirm the server's identity. Type yes and press Enter.

When prompted, enter the password for the nelson user.

You are now logged into your remote Debian server.

Becoming the Root User

We'll perform the remainder of the workshop as the root user.

Run:

su - root

When prompted, enter the root password that you created during the Debian installation.

Your command prompt should now indicate that you are logged in as the root user.

Address Reservation

Many home routers provide a feature that allows you to reserve an IP address for a particular device. This is often called DHCP Reservation, Address Reservation, or Static DHCP, although the name varies between router manufacturers. If your router supports this feature, it's a good idea to reserve an IP address for your Debian server so that it always receives the same IP address.

Installing Avahi

We'll also install Avahi, which allows computers on your local network to find the server by its hostname. This means you can connect using the computer's name instead of remembering its IP address.

Install Avahi with:

apt install avahi-daemon

Start the service and configure it to start automatically whenever the server boots:

systemctl enable --now avahi-daemon

If you named your computer bitcoin-node during the Debian installation, you can now connect using:

ssh nelson@bitcoin-node.local

If you chose a different hostname during installation, simply replace bitcoin-node with the name you selected.

From your Mac or Linux computer, you should now be able to connect using the server's hostname instead of its IP address.

Note: Windows does not recognise .local hostnames by default. If you're using PowerShell on Windows, you may need to continue connecting using the server's IP address unless you install additional software that provides this capability.

Installing Required Packages

We'll now install a number of packages that we'll need later in the workshop.

Run:

apt install git gpg build-essential pkg-config rustc cargo wget curl

These packages provide:

  • git – Version control software used to download and manage source code.
  • gpg – Used to verify software signatures and downloads.
  • build-essential – Installs the GNU compiler and other tools needed to build software from source.
  • pkg-config – Helps build systems locate installed libraries.
  • rustc – The Rust programming language compiler.
  • cargo – Rust's package manager and build tool.
  • wget - Pull in a web URL from the command line.
  • curl - Similar to wget but with extra features.

We'll make use of these tools throughout the remainder of the workshop.