Step 2: Configuring Node
⚒️ Node Configuration
Logging to the node
Using Ubuntu Server: Begin by connecting with your SSH client.
Using Ubuntu Desktop: You're likely in-front of your local node. Simply open a terminal window from anywhere by typing Ctrl+Alt+T.
Updating the node
Ensure all the latest packages and patches are installed first, then reboot.
sudo apt-get update -y && sudo apt dist-upgrade -y
sudo apt-get autoremove
sudo apt-get autoclean
sudo reboot🔑 Security Configuration
Create a non-root user with sudo privileges
🔥Important reminder: Ensure you are logged in and execute all steps in this guide as this non-root user, ethereum.
Hardening SSH Access
Transferring the SSH Public Key to Remote node
Disabling Password Authentication
Synchronizing time with Chrony
chrony is an implementation of the Network Time Protocol and helps to keep your computer's time synchronized with NTP.
To install chrony:
To see the source of synchronization data.
To view the current status of chrony.
Setting Timezone
To pick your timezone run the following command:
Find your region using the simple text-based GUI.
In the event that you are using national system like India's IST select:
This will be appropriate for all locales in the country (IST, GMT+0530).
Creating the jwtsecret file
A jwtsecret file contains a hexadecimal string that is passed to both Execution Layer client and Consensus Layer clients, and is used to ensure authenticated communications between both clients.
🔗 Network Configuration
The standard UFW - Uncomplicated firewall can be used to control network access to your node and protect against unwelcome intruders.
Configure UFW Defaults
By default, deny all incoming and outgoing traffic.
Configure SSH Port 22
If your node is remote in the cloud, you will need to enable SSH port 22 in order to connect.
If your node is local at home and you have keyboard access to it, it's good practice to deny SSH port 22.
Allow Execution Client Port 30303
Peering on port 30303, execution clients use this port for communication with other network peers.
Allow Consensus Client port
Consensus clients generally use port 9000 for communication with other network peers. Using tcp port 13000 and udp port 12000, Prysm uses a slightly different configuration.
Enable firewall
Finally, enable the firewall and review the configuration.
Example of ufw status for a remote staking node configured for Lighthouse consensus client.
Optional: Whitelisting Connections
Whitelisting, which means permitting connections from a specific IP, can be setup via the following command.
⛓️ Install Fail2ban
To install fail2ban:
Edit a config file that monitors SSH logins.
Add the following lines to the bottom of the file.
To exit and save, press Ctrl + X, then Y, thenEnter.
Restart fail2ban for settings to take effect.