You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/components/nitrokeys/features/fido2/ssh.rst
+23-27Lines changed: 23 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,26 +12,33 @@ Generating SSH Key
12
12
13
13
1. Insert the Nitrokey into your computer.
14
14
15
-
2. Open a terminal and execute the following command, replacing "your_comment" with a note to identify your key (e.g., "Nitrokey GitLab"). The -C "your_comment" parameter is optional — it only adds a label for identification (e.g., in GitLab or GitHub), and the command will work normally without it.
15
+
2. Open a terminal and create your SSH key. Replace ``"your_comment"`` with a label to identify it (e.g., "Nitrokey GitLab").
16
+
By default, the key is a non-resident key, meaning a local key handle is stored in ``~/.ssh/`` while the private key remains securely on the Nitrokey.
17
+
Use the ``-O resident`` option if you want the key to be portable across systems.
16
18
17
19
.. code-block:: shell-session
18
20
19
21
ssh-keygen -t ed25519-sk -C "your_comment"
20
22
21
-
3. You can optionally create a resident key, allowing it to be used on other computers without copying files. By default, SSH FIDO2 keys created with -t ed25519-sk are non-resident, meaning a local key handle is stored in ~/.ssh/ while the private key remains securely on the Nitrokey. Using -O resident provides portability across systems, but for single-system use, the standard ssh-keygen -t ed25519-sk command is sufficient.
On a new system you can list and load resident keys from the device with:
31
+
The ``-O resident`` option stores key handles on the Nitrokey, allowing others with physical access to list them and see where the key was used.
30
32
33
+
.. note::
34
+
35
+
Resident keys can later be listed and imported on another system with:
36
+
31
37
.. code-block:: shell-session
32
38
33
39
ssh-keygen -K
34
40
41
+
35
42
4. During key generation, you may also be asked to set a **passphrase**. This passphrase encrypts the local key handle stored in ``~/.ssh/`` (not the private key on the Nitrokey, which always stays securely inside the device). The passphrase is **different from the FIDO2 device PIN**: the PIN protects the physical key itself, while the passphrase protects your local SSH key files. Using both increases overall security.
36
43
37
44
5. When asked for a file path, accept the default option (``~/.ssh/id_ed25519_sk``) or choose a custom name like ``id_ed25519_sk_gitlab``.
@@ -55,34 +62,23 @@ Generating SSH Key
55
62
Adding Your Public Key
56
63
----------------------
57
64
58
-
1. Once your SSH key pair is generated, the public key must be added to the service or server you want to access.
65
+
Once your SSH key pair is generated, the public key must be added to the service or server you want to access.
2. Copy the output and add it to your account’s SSH key settings.
72
-
See `GitLab <https://docs.gitlab.com/user/ssh/#add-an-ssh-key-to-your-gitlab-account>` or `GitHub <https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account>` for detailed steps.
2. To allow SSH access to the remote servers, the same public key must be listed in the server’s ``~/.ssh/authorized_keys`` file. During authentication, the server checks for a matching key and verifies your identity through a challenge signed by your Nitrokey’s private key.
76
-
To add your key:
79
+
2. Copy the output and add it to your account’s SSH key settings.
77
80
78
-
.. code-block:: shell-session
81
+
See `GitLab <https://docs.gitlab.com/user/ssh/#add-an-ssh-key-to-your-gitlab-account>` or `GitHub <https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account>` for detailed steps.
To enable SSH remote server access, add your public key (from ``~/.ssh/id_ed25519_sk.pub``) to the ``~/.ssh/authorized_keys`` file of the user account. This allows passwordless authentication using your Nitrokey.
0 commit comments