Getting Started 3 min read Last updated: 2026-10-23

Connecting via SSH & Ed25519 Key Authentication

Connect from Windows, macOS, and Linux, generate Ed25519 SSH key pairs, and disable password authentication via sshd_config.d drop-in configurations.

SSH (Secure Shell) is the core encrypted management channel for Linux cloud servers. While initial password authentication allows immediate login after provisioning, migrating to Ed25519 Public Key Authentication completely eliminates credential brute-forcing and streamlines daily administration.

1. Choosing an SSH Client

Platform Recommended Client Key Highlights
Windows 10 / 11 Windows Terminal / PowerShell Built-in native OpenSSH client; zero third-party software required
macOS macOS Terminal / iTerm2 / Ghostty Native Unix shell with hardware-accelerated rendering
Cross-Platform (GUI) Termius / Tabby Modern interface with SFTP file browser and multi-device sync
Classic Windows PuTTY / Xshell / MobaXterm Traditional session managers with jump-host and X11 forwarding

2. Generating an Ed25519 Key Pair

On your local workstation (never on the remote server), open a terminal and generate a modern Ed25519 cryptographic key pair:

ssh-keygen -t ed25519 -C "your_email@example.com"
  1. Press Enter when prompted for the file path to save to the default location (~/.ssh/id_ed25519);
  2. Press Enter for an empty passphrase, or enter a passphrase to encrypt the local private key file;
  3. Two files will be created in ~/.ssh/:
    • Private Key: id_ed25519 (keep strictly confidential; never share or upload)
    • Public Key: id_ed25519.pub (safe to upload to your remote servers)

3. Deploying Your Public Key to FlawlessNode

Method A: Automated Deployment via ssh-copy-id (macOS / Linux)

ssh-copy-id -i ~/.ssh/id_ed25519.pub root@your_server_ip

Enter your current root password once. The utility automatically sets directory permissions and appends your public key to ~/.ssh/authorized_keys.

Method B: Manual Deployment (Windows PowerShell or Any OS)

  1. View and copy your public key string locally:
    # Windows PowerShell
    Get-Content ~\.ssh\id_ed25519.pub
    # macOS / Linux
    cat ~/.ssh/id_ed25519.pub
  2. Log in to your remote server and execute:
    mkdir -p ~/.ssh
    chmod 700 ~/.ssh
    echo "PASTE_YOUR_PUBLIC_KEY_HERE" >> ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys

4. Verifying Key Login & Disabling Password Authentication

First, test passwordless key login in a new local terminal window:

ssh -i ~/.ssh/id_ed25519 root@your_server_ip

If you log in directly without a password prompt, your Ed25519 key is active!

Hardening OpenSSH: Disabling Password Logins (sshd_config.d)

[!IMPORTANT] Modern distributions (Ubuntu 22.04/24.04/26.04 LTS, Debian 12/13, and Rocky/AlmaLinux 9/10) include /etc/ssh/sshd_config.d/*.conf (such as 50-cloud-init.conf) at the very top of /etc/ssh/sshd_config. Because OpenSSH uses a first-match-wins rule, creating a 01-hardening.conf drop-in file ensures your security settings take highest precedence and survive OS package upgrades.

  1. Create /etc/ssh/sshd_config.d/01-hardening.conf:
    cat << 'EOF' | sudo tee /etc/ssh/sshd_config.d/01-hardening.conf
    PubkeyAuthentication yes
    PasswordAuthentication no
    KbdInteractiveAuthentication no
    PermitEmptyPasswords no
    EOF
  2. Validate the OpenSSH configuration syntax and restart the daemon:
    # Verify syntax (no output means valid)
    sudo sshd -t
    
    # Restart SSH service on Debian / Ubuntu
    sudo systemctl restart ssh
    
    # Or on AlmaLinux / Rocky Linux
    sudo systemctl restart sshd

[!WARNING] Do NOT close your current SSH session immediately after restarting the SSH service! Open a second terminal window and verify that you can still log in before closing your original session.


5. Troubleshooting Common SSH Errors

Q: Permission denied (publickey)

  • Verify directory and file ownership/permissions via VNC Console: ~/.ssh must be 700 (chmod 700 ~/.ssh) and ~/.ssh/authorized_keys must be 600 (chmod 600 ~/.ssh/authorized_keys);
  • On AlmaLinux / Rocky Linux with SELinux enabled, restore the security context: restorecon -Rv ~/.ssh.

Q: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

  • This appears after you reinstall the operating system via VirtFusion because the server generates a brand-new SSH host key;
  • Clear the cached old fingerprint on your local machine by running:
    ssh-keygen -R your_server_ip
Was this page helpful?