Servers and cloud

Copy your SSH key to a server (log in without a password)

Put your public key on a server once, then SSH in without typing its password.

Fill these in once
  1. Copy your public key to the server
    Terminal
    ssh-copy-id ubuntu@203.0.113.10

    It asks for the server password one last time.

Check it worked

  1. Log in without a password
    Terminal
    ssh ubuntu@203.0.113.10
  1. Copy your public key to the server
    Terminal · Ubuntu / Debian
    ssh-copy-id ubuntu@203.0.113.10

    It asks for the server password one last time.

Check it worked

  1. Log in without a password
    Terminal · Ubuntu / Debian
    ssh ubuntu@203.0.113.10
  1. Copy your public key to the server
    PowerShell
    Get-Content "$env:USERPROFILE\.ssh\id_ed25519.pub" | ssh ubuntu@203.0.113.10 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

    Windows has no ssh-copy-id, so this does the same thing. It asks for the server password one last time.

Check it worked

  1. Log in without a password
    PowerShell
    ssh ubuntu@203.0.113.10