Actually add `Configuring SSH'

This commit is contained in:
styan 2020-06-11 08:25:30 +00:00
parent f717444a2d
commit e32e91fa2c
1 changed files with 45 additions and 0 deletions

45
docs/ssh-config.md Normal file
View File

@ -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)