diff --git a/docs/ssh-config.md b/docs/ssh-config.md new file mode 100644 index 0000000..18a2a78 --- /dev/null +++ b/docs/ssh-config.md @@ -0,0 +1,45 @@ +# Configuring SSH + +## Setting a Default Username + +If your username is different on your tilde than on your personal computer, +you may want to specify a default username in `~/.ssh/config`. +That can be done by adding the following entries: + + Host tilde.black + User user + +## Using a Tilde-Specific key + +### Step 1: Generate Your Key + +[Generate a key](ed25519.md), except outputting to a Tilde-specific location. + + mkdir -p ~/.ssh/tilde.black + ssh-keygen -a100 -ted25519 -f ~/.ssh/tilde.black/id_ed25519 -C '' + +### Step 2: Authorize Your Key + +If you have yet to [sign up](sign-up.md) to your desired Tilde, +send the *public* key (`~/.ssh/tilde.black/id_ed25519.pub`) to the admin. + +If you already have an account, you can authorize your new key by adding it to, +or replacing your old key in, `~/.ssh/authorized_keys`. + + $ scp ~/.ssh/tilde.black/id_ed25519.pub user@tilde.black:key.pub + $ ssh user@tilde.black + tilde$ cat key.pub >> .ssh/authorized_keys + tilde$ rm key.pub + +### Step 3: Configure SSH + +To make `ssh(1)` *only* use that key for that tilde, you can add the following +lines to `~/.ssh/config`: + + Host tilde.black + IdentitiesOnly yes + IdentityFile ~/.ssh/tilde.black/id_ed25519 + +## See Also + +[SSH over Tor](ssh-over-tor.md)