Ethereum - Ubuntu for Beginners

Introduction

Goal: Teach basic Ubuntu concepts and skills in order to encourage home staking on Ethereum. The target audience is anyone with basic tech skills and a desire to learn.

This is part of a broader Ethereum educational effort. Find other Eth2 community resources here.

Table of Contents

Ubuntu 20.04 - Desktop

Ubuntu desktop has several features that make it ideal for running a validator on Ethereum 2.0:

If you'd like to try Ubuntu, you can use these instructions to create an Ubuntu live USB:

Ubuntu - Security

Ubuntu is secure right out of the box and is generally resistant to viruses and malware. The best way to maintain a secure environment is to use it as a dedicated Ethereum machine. No other applications.

Home PC vs "Headless" Server

Ubuntu has both desktop and server versions. Servers have no graphical user interface (GUI), which means the only access to a server is through terminal commands (CLI).

Ubuntu desktop allows you to operate in a normal desktop environment (GUI) while still using CLI.

For most users, a home PC is easier to operate and more secure than a remote server because you have direct physical access, which allows you to disable remote logins and prevent the majority of attacks.

Ubuntu - Applications

Application Names: Windows vs Ubuntu

Open-source applications have come a long way in recent years, and many FOSS programs are now as good or better than their closed-source counterparts.

You can visually explore different directories and files using the Graphical User Interface (GUI)

Basic text editor for simple documents and copy/pasting

Running an Ethereum validator requires entering commands directly into the terminal (aka command line interface). CLI can be intimidating at first, but it's fairly intuitive and easy to learn.

You can use the following shortcuts for Linux CLI:

  • Ctrl + Alt + T || Open new terminal window

  • Ctrl + Shift + C || Copy selected contents from terminal window

  • Ctrl + Shift + V || Paste contents into terminal window

  • Ctrl + C || Stop a running terminal process

  • Up/down Arrows || Cycle through last used commands

This tool is helpful if you have an error and want to post a screenshot in the EthStaker Discord for help.

Dual View - CLI & GUI

Open a terminal window with Ctrl + Alt + T and move it alongside the file viewer. This allows you to see information displayed through Command Line Interface (CLI) and Graphical User Interface (GUI).

The screenshot below shows the contents of the Home directory through both CLI and GUI.

Linux - Directories

Linux systems do not have "drives" like with Windows (e.g. C: or D:).

The entire Linux directory system is a series of nested directories, with the top being the /root directory.

Root Directory

AVOID USING ROOT ACCESS

The root directory contains all other directories, and the root user has control over the entire system. A mistake while working as root user can cause irreparable damage.

The best practice is to generally never use root access, and instead have regular users that can use the sudo command

Sudo Command

Adding sudo to the front a command runs the terminal command as administrator. This helps prevent accidents because the user doesn't have root access, but they are still able to run commands as admin when needed.

If you get an error that you don't have permission to perform this action, you may need to use sudo

Username

This guide was created on a PC named ubuntu with the username ubuntu You'll notice that CLI below starts with ubuntu@ubuntu which identifies user@pcname

You can use the command whoami to see the current user name.

Important Directories

When you open a new terminal, it will begin in the home directory

Linux Terminal - Basic Commands

This table shows a list of commands, but the following section will discuss in greater detail.

Now that we've covered directories and commands, let's practice with a few exercises.

Last updated