mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(kb/gpg+ssh): improve article sections and examples about gnupg integration with ssh
This commit is contained in:
@@ -86,3 +86,6 @@ HashKnownHosts no
|
||||
ServerAliveCountMax 2
|
||||
ServerAliveInterval 300
|
||||
UseKeyChain yes
|
||||
|
||||
# GnuPG integration
|
||||
IdentityAgent ~/.gnupg/S.gpg-agent.ssh
|
||||
|
||||
@@ -379,10 +379,11 @@ Now tell SSH how to access `gpg-agent` by setting the value of the `SSH_AUTH_SOC
|
||||
Alternatively, and for a more permanent solution, set the option in the `.ssh/config` file:
|
||||
|
||||
```sh
|
||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs 'agent-ssh-socket')
|
||||
|
||||
# alternative
|
||||
echo "IdentityAgent $(gpgconf --list-dirs agent-ssh-socket)" >> ~'/.ssh/config'
|
||||
echo "\nIdentityAgent $(gpgconf --list-dirs 'agent-ssh-socket')" \
|
||||
| tee -a ~'/.ssh/config'
|
||||
```
|
||||
|
||||
Now you can launch the gpg agent:
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
1. [Client configuration](#client-configuration)
|
||||
1. [Append domains to a hostname before attempting to check if they exist](#append-domains-to-a-hostname-before-attempting-to-check-if-they-exist)
|
||||
1. [Optimize connection handling](#optimize-connection-handling)
|
||||
1. [Integrate with GnuPG](#integrate-with-gnupg)
|
||||
1. [Server configuration](#server-configuration)
|
||||
1. [Change port](#change-port)
|
||||
1. [Disable password authentication](#disable-password-authentication)
|
||||
@@ -229,6 +230,22 @@ ControlPath ~/.ssh/control-%C
|
||||
ControlPersist 30s
|
||||
```
|
||||
|
||||
### Integrate with GnuPG
|
||||
|
||||
```sh
|
||||
# In BASH and alike.
|
||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs 'agent-ssh-socket')
|
||||
|
||||
# In FISH.
|
||||
set -x 'SSH_AUTH_SOCK' (gpgconf --list-dirs 'agent-ssh-socket')
|
||||
```
|
||||
|
||||
```ssh-config
|
||||
# In ~/.ssh/config.
|
||||
# Value is from `gpgconf --list-dirs 'agent-ssh-socket'`.
|
||||
IdentityAgent ~/.gnupg/S.gpg-agent.ssh
|
||||
```
|
||||
|
||||
## Server configuration
|
||||
|
||||
Config file defaults to `/etc/ssh/sshd_config`.<br/>
|
||||
|
||||
Reference in New Issue
Block a user