Step 2: Configuring Node

User creation, directory structure, SSH hardening, Fail2Ban, and Firewall.

Step 2: Configuring Node

Security is paramount for node operators. A compromised server can lead to loss of validator keys, slashing, or the node being used for malicious attacks.

In this step, we will create a dedicated service user, secure remote access, and configure the firewall.

1. Create the ethereum Service User

Running services as root is a security risk. We will create a dedicated user named ethereum to run our node software.

Bash

# Create the user with a home directory
sudo adduser --disabled-password --gecos "" ethereum

# (Optional) Add to sudo group if you plan to manage the server with this user
sudo usermod -aG sudo ethereum

2. Configure Directory Structure

We will organize the Execution and Consensus data within the ethereum user's home directory. This keeps permissions clean and backups simple.

💡 Note: While we use /home/ethereum for this guide, you can configure these paths to point to a separate mounted drive (e.g., /mnt/nvme/ethereum) if your storage is on a different partition.

Run the following to create the structure and set permissions:

Bash

3. Generate JWT Secret

The Execution Client (EL) and Consensus Client (CL) communicate via an authenticated port (Engine API). They need a shared secret token to talk to each other.

Bash


4. System Hardening (SSH)

We will now secure remote access by enforcing Key-Based Authentication and disabling password logins.

⚠️ Critical Warning: Ensure you have added your SSH Public Key (id_rsa.pub) to the server before running these commands, or you will lock yourself out.

A. Add your SSH Key (If not already done) From your local machine:

Bash

B. Modify SSH Configuration Edit the SSH daemon config file:

Bash

Find and modify the following lines to match these settings:

Ini, TOML

C. Restart SSH Service Apply the changes. Do not close your current terminal until you have verified you can log in via a new terminal window.

Bash


5. Firewall Configuration (UFW)

We strictly whitelist only the ports required for the node to function.

Bash

🛡️ Security Check: Note that we did NOT open ports 8545 (HTTP JSON-RPC) or 8551 (Engine API). These ports grant administrative control over your node and should never be exposed to the public internet without a reverse proxy (Nginx) and authentication.


✅ Checklist: Ready for Client Installation?

  • [ ] User ethereum created.

  • [ ] Directories created in /home/ethereum.

  • [ ] jwt.hex generated.

  • [ ] SSH is secured (Keys only).

  • [ ] Firewall is active.


Last updated