Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize and refine SSH config proposed in README #12

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,27 @@ Host *
IdentitiesOnly yes
```

And then specify what keys should be used for each host
and above this block (the first matching option is applied,
`Host \*` directives must come last),
specify what keys should be used for each host:

```
Host example.com
PubkeyAuthentication yes
IdentityFile ~/.ssh/id_rsa
# IdentitiesOnly yes # Enable ssh-agent (PKCS11 etc.) keys
```

If you want you can use different keys so that they can't be linked together
Or, if you want to use different keys so that they can't be linked together:

```
Host github.com
PubkeyAuthentication yes
IdentityFile ~/.ssh/github_id_rsa
Host *
# Only use identity files, not any identity loaded in ssh-agent
IdentitiesOnly yes
# Define pattern for the names of identity files by host
IdentityFile %d/.ssh/%h.rsa
IdentityFile %d/.ssh/%h.dsa
IdentityFile %d/.ssh/%h.ecdsa
# %d = local user's home directory
# %h = remote host name
# See IdentityFile section in `man ssh_config` for alternatives.
```