Skip to content

Commit 9c8f869

Browse files
authored
Merge pull request #481 from drduh/wip-06apr25
style markdown alerts
2 parents 0b018bf + b5ab51d commit 9c8f869

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.~*

README.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ Power off, remove internal hard drives and all unnecessary devices, such as the
160160

161161
Load the operating system and configure networking. Optional hardening steps related to networking can be found [below](#network-considerations).
162162

163-
**Note** If the screen locks on Debian Live, unlock with `user` / `live`
163+
> [!TIP]
164+
> If the screen locks on Debian Live, unlock with `user` / `live`
164165
165166
Open terminal and install required software packages.
166167

@@ -192,7 +193,8 @@ brew install \
192193
gnupg yubikey-personalization ykman pinentry-mac wget
193194
```
194195

195-
**Note** An additional Python package dependency may need to be installed to use [`ykman`](https://support.yubico.com/support/solutions/articles/15000012643-yubikey-manager-cli-ykman-user-guide) - `pip install yubikey-manager`
196+
> [!NOTE]
197+
> An additional Python package dependency may need to be installed to use [`ykman`](https://support.yubico.com/support/solutions/articles/15000012643-yubikey-manager-cli-ykman-user-guide) - `pip install yubikey-manager`
196198
197199
**NixOS**
198200

@@ -311,7 +313,8 @@ use-agent
311313
throw-keyids
312314
```
313315

314-
**Note** Networking can be disabled for the remainder of the setup.
316+
> [!IMPORTANT]
317+
> Networking should be disabled for the remainder of the setup.
315318
316319
## Identity
317320

@@ -524,7 +527,8 @@ $ sudo fdisk -l /dev/sdc
524527
Disk /dev/sdc: 14.9 GiB, 15931539456 bytes, 31116288 sectors
525528
```
526529

527-
**Warning** Confirm the destination (`of`) before issuing the following command - it is destructive! This guide uses `/dev/sdc` throughout, but this value may be different on your system.
530+
> [!WARNING]
531+
> Confirm the destination (`of`) before issuing the following command - it is destructive! This guide uses `/dev/sdc` throughout, but this value may be different on your system.
528532
529533
Zero the header to prepare for encryption:
530534

@@ -821,7 +825,8 @@ EOF
821825

822826
Remove and re-insert YubiKey.
823827

824-
**Warning** Three incorrect *User PIN* entries will cause it to become blocked and must be unblocked with either the *Admin PIN* or *Reset Code*. Three incorrect *Admin PIN* or *Reset Code* entries will destroy data on YubiKey.
828+
> [!CAUTION]
829+
> Three incorrect *User PIN* entries will cause it to become blocked and must be unblocked with either the *Admin PIN* or *Reset Code*. Three incorrect *Admin PIN* or *Reset Code* entries will destroy data on YubiKey.
825830
826831
The number of [retry attempts](https://docs.yubico.com/software/yubikey/tools/ykman/OpenPGP_Commands.html#ykman-openpgp-access-set-retries-options-pin-retries-reset-code-retries-admin-pin-retries) can be changed, for example to 5 attempts:
827832

@@ -1167,7 +1172,8 @@ Encryption:
11671172
ykman openpgp keys set-touch dec on
11681173
```
11691174

1170-
**Note** Versions of YubiKey Manager before 5.1.0 use `enc` instead of `dec` for encryption:
1175+
> [!NOTE]
1176+
> YubiKey Manager prior to versions 5.1.0 use `enc` instead of `dec` for encryption:
11711177
11721178
```console
11731179
ykman openpgp keys set-touch enc on
@@ -1351,7 +1357,7 @@ The goal is to configure SSH client inside WSL work together with the Windows ag
13511357

13521358
See the [WSL agent architecture](media/schema_gpg.png) illustration for an overview.
13531359

1354-
**Note** GnuPG forwarding for cryptographic operations is not supported. See [vuori/weasel-pageant](https://github.com/vuori/weasel-pageant) for more information.
1360+
GnuPG forwarding for cryptographic operations is not supported. See [vuori/weasel-pageant](https://github.com/vuori/weasel-pageant) for more information.
13551361

13561362
One way to forward is just `ssh -A` (still need to eval weasel to setup local ssh-agent), and only relies on OpenSSH. In this track, `ForwardAgent` and `AllowAgentForwarding` in ssh/sshd config may be involved. However, when using ssh socket forwarding, do not enable `ForwardAgent` in ssh config. See [SSH Agent Forwarding](#ssh-agent-forwarding) for more information. This requires Ubuntu 16.04 or newer for WSL and Kleopatra.
13571363

@@ -1367,7 +1373,7 @@ Edit `~/.ssh/config` to add the following for each agent forwarding host:
13671373
RemoteForward <remote SSH socket path> /tmp/S.weasel-pageant
13681374
```
13691375

1370-
**Note** The remote SSH socket path can be found with `gpgconf --list-dirs agent-ssh-socket`
1376+
The remote SSH socket path can be found with `gpgconf --list-dirs agent-ssh-socket`
13711377

13721378
Add the following to the shell rc file:
13731379

@@ -1442,7 +1448,8 @@ For `S.gpg-agent.ssh` (see [SSH Agent Forwarding](#ssh-agent-forwarding) for mor
14421448
14431449
### Copy public key
14441450
1445-
**Note** It is **not** necessary to import the GnuPG public key in order to use SSH only.
1451+
> [!TIP]
1452+
> It is **not** necessary to import the GnuPG public key in order to use SSH only.
14461453
14471454
Copy and paste the output from `ssh-add` to the server's `authorized_keys` file:
14481455
@@ -1531,7 +1538,8 @@ When using the key `pinentry` will be invoked to request the key passphrase. The
15311538
15321539
### SSH agent forwarding
15331540
1534-
**Warning** SSH Agent Forwarding can [add additional risk](https://matrix.org/blog/2019/05/08/post-mortem-and-remediations-for-apr-11-security-incident/#ssh-agent-forwarding-should-be-disabled) - proceed with caution!
1541+
> [!CAUTION]
1542+
> SSH Agent Forwarding can [add additional risk](https://matrix.org/blog/2019/05/08/post-mortem-and-remediations-for-apr-11-security-incident/#ssh-agent-forwarding-should-be-disabled) - proceed with caution!
15351543
15361544
There are two methods for ssh-agent forwarding, one is provided by OpenSSH and the other is provided by GnuPG.
15371545
@@ -1574,7 +1582,7 @@ export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
15741582
15751583
After sourcing the shell rc file, `ssh-add -l` will return the correct public key.
15761584
1577-
**Note** In this process no gpg-agent in the remote is involved, hence `gpg-agent.conf` in the remote is of no use. Also pinentry is invoked locally.
1585+
In this process no gpg-agent in the remote is involved, hence `gpg-agent.conf` in the remote is of no use. Also pinentry is invoked locally.
15781586
15791587
#### Chained forwarding
15801588
@@ -1619,8 +1627,6 @@ git config --global gpg.program 'C:\Program Files (x86)\GnuPG\bin\gpg.exe'
16191627
16201628
Then update the repository URL to `[email protected]:USERNAME/repository`
16211629
1622-
**Note** For the error `gpg: signing failed: No secret key` - run `gpg --card-status` with YubiKey plugged in and try the git command again.
1623-
16241630
## GnuPG agent forwarding
16251631
16261632
YubiKey can be used sign git commits and decrypt files on remote hosts with GnuPG Agent Forwarding. To ssh through another network, especially to push to/pull from GitHub using ssh, see [Remote Machines (SSH Agent forwarding)](#ssh-agent-forwarding).
@@ -1674,7 +1680,8 @@ pinentry-program /usr/bin/pinentry-gtk-2
16741680
extra-socket /run/user/1000/gnupg/S.gpg-agent.extra
16751681
```
16761682
1677-
**Note** The pinentry program starts on the *local* host, not remote.
1683+
> [!IMPORTANT]
1684+
> The pinentry program starts on the *local* host, not remote.
16781685
16791686
**Important** Any pinentry program except `pinentry-tty` or `pinentry-curses` may be used. This is because local `gpg-agent` may start headlessly (by systemd without `$GPG_TTY` set locally telling which tty it is on), thus failed to obtain the pin. Errors on the remote may be misleading saying that there is *IO Error*. (Yes, internally there is actually an *IO Error* since it happens when writing to/reading from tty while finding no tty to use, but for end users this is not friendly.)
16801687
@@ -1694,7 +1701,7 @@ Host third
16941701
16951702
You should change the path according to `gpgconf --list-dirs agent-socket` on *remote* and *third*.
16961703
1697-
**Note** On *local* you have `S.gpg-agent.extra` whereas on *remote* and *third*, you only have `S.gpg-agent`
1704+
On *local* you have `S.gpg-agent.extra` whereas on *remote* and *third*, you only have `S.gpg-agent`
16981705
16991706
## Using multiple YubiKeys
17001707
@@ -2044,7 +2051,8 @@ sudo service rng-tools restart
20442051
20452052
## Enable KDF
20462053
2047-
**Note** This feature may not be compatible with older GnuPG versions, especially mobile clients. These incompatible clients will not function because the PIN will always be rejected.
2054+
> [!IMPORTANT]
2055+
> This feature may not be compatible with older GnuPG versions, especially mobile clients. These incompatible clients will not function because the PIN will always be rejected.
20482056
20492057
This step must be completed before changing PINs or moving keys or an error will occur: `gpg: error for setup KDF: Conditions of use not satisfied`
20502058

0 commit comments

Comments
 (0)