SSH public key

A quick way to set up access when we're working together on a server.

Install my key

Run this as the account I should log into. It adds my ED25519 public key, sets SSH file permissions, and skips the key if it's already installed.

This grants me SSH access to that account. To remove access later, delete my key's line from ~/.ssh/authorized_keys.

ED25519

Public key

PUBLIC KEY
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIit8iMku3xd6QXTZ3h8BbYbtKBu+QNS1SA3W1Y0cTWb preston

You can also paste this key into your hosting provider's SSH key settings.

Legacy RSA key ↗

Manual installation

  1. Create the directory and set its permissions.mkdir -p ~/.ssh && chmod 700 ~/.ssh
  2. Create the authorized keys file and restrict its permissions.touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys
  3. Add the public key above on its own line in ~/.ssh/authorized_keys, keeping any existing keys.