LightYear
/Docs
DocsGetting StartedCreate and Manage SSH Keys

Create and Manage SSH Keys

Generate an SSH key pair, add it to your LightYear account, and use it for passwordless server access.

beginner
5 min read
LightYear Team
Updated April 24, 2026
sshsecuritykeys
Ready to get started?

Why SSH Keys?

SSH key authentication is more secure than passwords. A private key never leaves your machine; the server only stores the corresponding public key.

Generating a Key Pair

Linux / macOS

>_BASH
$ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/lightyear_key

This creates:

  • ~/.ssh/lightyear_key — private key (keep this secret)
  • ~/.ssh/lightyear_key.pub — public key (upload this)

Windows (PowerShell)

POWERSHELL
ssh-keygen -t ed25519 -C "[email protected]" -f "$env:USERPROFILE\.ssh\lightyear_key"

Adding Your Key to LightYear

  1. Copy your public key:
    >_BASH
    $cat ~/.ssh/lightyear_key.pub
  2. Go to Account → SSH Keys → Add SSH Key.
  3. Paste the public key and give it a label.

Using the Key at Deploy Time

When deploying a server, select your saved key from the SSH Key dropdown. The key is injected into /root/.ssh/authorized_keys automatically.

Connecting

>_BASH
$ssh -i ~/.ssh/lightyear_key root@<SERVER_IP>

Rotating Keys

To rotate a key:

  1. Generate a new key pair.
  2. Add the new public key to your running server: echo "<new-pubkey>" >> ~/.ssh/authorized_keys
  3. Update your LightYear account with the new key.
  4. Remove the old key from authorized_keys.

Was this article helpful?

Your cookie choices for this website

This site uses cookies and related technologies, as described in our privacy policy, for purposes that may include site operation, analytics, and enhanced user experience. You may choose to consent to our use of these technologies, or manage your own preferences. Cookie policy