🧩Multi-Factor Authentication (MFA) for a Validator
Multi-Factor Authentication (MFA) is a crucial security measure for a validator. It prevents unauthorized access to the server, wallet, and critical node management systems.
Setting Up MFA for SSH Access
Enabling Two-Factor Authentication with Google Authenticator
Install Google Authenticator
sudo apt update && sudo apt install libpam-google-authenticator -yGenerate a Secret Key
google-authenticatorA QR code and key will appear. Save your backup codes!
Configure PAM for SSH
sudo nano /etc/pam.d/sshdAdd this line at the beginning:
auth required pam_google_authenticator.soEnable MFA in the SSH Configuration
sudo nano /etc/ssh/sshd_configModify the following parameters:
ChallengeResponseAuthentication yes
AuthenticationMethods publickey,keyboard-interactiveRestart SSH:
sudo systemctl restart sshdNow, SSH access will require a one-time password (OTP) from Google Authenticator.
MFA for Hardware Security Keys (YubiKey)
Install FIDO2/U2F Support
sudo apt install libpam-u2f -yRegister Your YubiKey
mkdir -p ~/.config/Yubico
pamu2fcfg > ~/.config/Yubico/u2f_keysPress the YubiKey button to confirm registration.
Configure PAM for SSH
sudo nano /etc/pam.d/sshdAdd:
auth required pam_u2f.soNow, SSH access will require the hardware security key.
MFA for the Validator Wallet
Best Option – Hardware Wallet (Ledger, Trezor)
Store private keys on Ledger Nano X or Trezor Model T.
Connect only when signing transactions.
Keplr + Ledger is an ideal solution for Cosmos validators.
Securing a Hot Wallet
If the wallet is stored on the server, run:
chmod 600 ~/.wallet/keystore
chown username:username ~/.wallet/keystoreBackup your mnemonic phrase offline.
Restrict access to wallet files using ACL (Access Control List).
MFA for Monitoring and API
Securing Grafana with a Password + MFA
Enable OAuth 2.0 with Google/Auth0 for Grafana.
Restrict access to Grafana with 2FA.
Set up Fail2Ban to protect against brute-force attacks:
sudo nano /etc/fail2ban/jail.localAdd:
[grafana]
enabled = true
port = 3000
filter = grafana
logpath = /var/log/grafana/grafana.log
maxretry = 5
bantime = 3600Apply changes:
sudo systemctl restart fail2banProtecting RPC and API with MFA
Securing RPC Access via NGINX + OAuth
Install NGINX + JWT authentication.
Restrict access to
/rpc,/apiby IP addresses and keys.Implement Cloudflare Access to enforce MFA for API access.
Last updated