VALIDEXIS Services
  • ๐Ÿ‘‹ About US
  • ๐ŸŒ Supported Networks
  • ๐ŸŒ Our Validators
  • ๐Ÿ” Validator Security: Our Approach and Protection Measures
    • ๐Ÿ”’Enhancing SSH Security for a Validator
    • ๐Ÿ“ก TMKMS for Remote Signing
    • ๐Ÿ”‘ Horcrux
    • ๐Ÿ›ก๏ธ Protecting Validator from DDoS Attacks
    • ๐ŸงฉMulti-Factor Authentication (MFA) for a Validator
  • ๐ŸšจMonitoring
    • ๐Ÿ“Š Node-exporter + Prometheus + Grafana
    • ๐Ÿ•ต๏ธ TenderDuty for Node Monitoring
  • ๐Ÿงต Setting up connection to IBC with Hermes
  • ๐Ÿค–CelestiaUltraBot
    • ๐Ÿ† Contest
    • ๐Ÿš€ Getting started
    • ๐Ÿ–ฅ๏ธ Validator monitoring
    • ๐Ÿ” Bridge Node Monitoring
    • ๐Ÿ‘› Wallet
    • ๐Ÿ›ธ AI Troubleshooting
  • ๐ŸŸข MAINNETS
    • Celestia
      • ๐Ÿ—‚๏ธ API/RPC/gRPC/AddrBook
      • ๐Ÿ“ธ Snapshot
      • ๐Ÿ”— Validator Node Installation
        • ๐Ÿ› ๏ธ Upgrade
        • ๐Ÿ“œ Useful Commands
      • ๐Ÿ’พ Full Node Installation
        • ๐Ÿ› ๏ธ Upgrade
        • ๐Ÿ“œ Useful Commands
      • ๐ŸŒ‰ Bridge Node Installation
        • ๐Ÿ› ๏ธ Upgrade
        • ๐Ÿ“œ Useful Commands
      • ๐Ÿ’ก Light Node Installation
        • ๐Ÿ› ๏ธ Upgrade
        • ๐Ÿ“œ Useful Commands
    • Zetachain
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • Xion
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • Nibiru
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • Kyve
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • Juno
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • Agoric
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • CosmosHub
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • Lava
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • Uptick
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • Paloma
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • Kusama
      • ๐Ÿ—‚๏ธ API/RPC
      • ๐Ÿ“ธ Snapshot
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • Polkadot
      • ๐Ÿ—‚๏ธ API/RPC
      • ๐Ÿ“ธ Snapshot
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
      • ๐Ÿ”ง Installing a Polkadot Node Using Kagome
      • ๐Ÿงช Benchmarking a Server for Substrate/Polkadot
      • ๐Ÿ“˜ Monitoring Polkadot Nodes with Prometheus and Alertmanager
      • ๐Ÿ” UFW Security Template
    • Starknet
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
    • NYM
      • โš™๏ธ Installation
      • ๐Ÿ› ๏ธ Upgrade
      • ๐Ÿ“œ Useful Commands
  • ๐ŸŸก TESTNETS
    • Celestia
      • ๐Ÿ—‚๏ธ API/RPC/AddrBook
      • ๐Ÿ“ธ Snapshot
      • ๐Ÿ”— Validator Node Installation
        • ๐Ÿ› ๏ธ Upgrade
        • ๐Ÿ“œ Useful Commands
      • ๐Ÿ’พ Full Node Installation
        • ๐Ÿ› ๏ธ Upgrade
        • ๐Ÿ“œ Useful Commands
      • ๐ŸŒ‰ Bridge Node Installation
        • ๐Ÿ› ๏ธ Upgrade
        • ๐Ÿ“œ Useful Commands
      • ๐Ÿ’ก Light Node Installation
        • ๐Ÿ› ๏ธ Upgrade
        • ๐Ÿ“œ Useful Commands
Powered by GitBook
On this page
  • 1. Changing the Default SSH Port
  • 2. Disabling Password Authentication
  • 3. Restricting SSH Access to Specific Users
  • 4. Enabling Two-Factor Authentication (2FA)
  • 5. Limiting Failed Login Attempts
  • 6. Restricting SSH Access by IP (Whitelist)
  • 7. Configuring the Firewall (UFW)
  • 8. Monitoring SSH Access
  1. ๐Ÿ” Validator Security: Our Approach and Protection Measures

๐Ÿ”’Enhancing SSH Security for a Validator

Securing SSH access is critical to protecting your validator. This guide covers essential security measures to minimize the risk of unauthorized access.

1. Changing the Default SSH Port

By default, SSH runs on port 22, making it an easy target for attacks. Changing it to a non-standard port improves security.

  1. Open the SSH configuration file:

    sudo nano /etc/ssh/sshd_config
  2. Find the line:

    #Port 22

    Change it to something like:

    Port 2222
  3. Save changes (Ctrl + X โ†’ Y โ†’ Enter) and restart SSH:

    sudo systemctl restart sshd

Important: Make sure the new port is allowed in your firewall.

sudo ufw allow 2222/tcp

2. Disabling Password Authentication

Using passwords makes your server vulnerable to brute-force attacks. SSH keys provide better security.

Generating SSH Keys

On your local computer (not the server), run:

ssh-keygen -t ed25519 -C "your_email@example.com"

This creates private (~/.ssh/id_ed25519) and public (~/.ssh/id_ed25519.pub) keys.

Adding the Key to the Server

Copy the public key to your server:

ssh-copy-id -p 2222 user@your_server

Or manually:

cat ~/.ssh/id_ed25519.pub | ssh -p 2222 user@your_server "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Disabling Password Authentication

Edit the SSH config:

sudo nano /etc/ssh/sshd_config

Find and change:

PasswordAuthentication no

Restart SSH:

sudo systemctl restart sshd

3. Restricting SSH Access to Specific Users

Limit SSH access to selected users for additional security.

In /etc/ssh/sshd_config, add:

AllowUsers validator_user

Restart SSH:

sudo systemctl restart sshd

4. Enabling Two-Factor Authentication (2FA)

Adding 2FA enhances security with an additional authentication step.

  1. Install Google Authenticator:

    sudo apt install libpam-google-authenticator
  2. Run the setup:

    google-authenticator

    Follow the instructions and scan the QR code in the Google Authenticator app.

  3. Enable 2FA in SSH: Edit /etc/pam.d/sshd and add:

    auth required pam_google_authenticator.so
  4. In /etc/ssh/sshd_config, enable challenge-response authentication:

    ChallengeResponseAuthentication yes
  5. Restart SSH:

    sudo systemctl restart sshd

5. Limiting Failed Login Attempts

Use Fail2Ban to protect against brute-force attacks.

Installing and Configuring Fail2Ban

sudo apt install fail2ban -y

Create a configuration file:

sudo nano /etc/fail2ban/jail.local

Add:

[sshd]
enabled = true
port = 2222
maxretry = 3
findtime = 600
bantime = 3600

Restart Fail2Ban:

sudo systemctl restart fail2ban

6. Restricting SSH Access by IP (Whitelist)

If you have a static IP, restrict SSH access to that IP only.

Edit /etc/hosts.allow:

sshd: 192.168.1.100

Block all other IPs in /etc/hosts.deny:

sshd: ALL

7. Configuring the Firewall (UFW)

Close unnecessary ports and allow only the SSH port you set.

sudo ufw allow 2222/tcp
sudo ufw enable

Check firewall status:

sudo ufw status verbose

8. Monitoring SSH Access

Check active SSH sessions:

who

View login attempts:

sudo cat /var/log/auth.log | grep "Failed"

Now your SSH access is well-protected. The key security measures include SSH keys instead of passwords, 2FA, Fail2Ban, and firewall rules.

Previous๐Ÿ” Validator Security: Our Approach and Protection MeasuresNext๐Ÿ“ก TMKMS for Remote Signing

Last updated 3 months ago