From 8352cc9a23a5fea11d467a5b8341b24cd162c62a Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 15 Jun 2021 11:49:19 +0200 Subject: [PATCH 1/2] nixos/ssh: Add an example of verbatim keys This confused someone on SO. --- nixos/modules/services/networking/ssh/sshd.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index 089c7a12afba..87418a1bf219 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -41,6 +41,10 @@ let Warning: If you are using NixOps then don't use this option since it will replace the key required for deployment via ssh. ''; + example = [ + "ssh-rsa AAAAB3NzaC1yc2etc/etc/etcjwrsh8e596z6J0l7 example@host" + "ssh-ed25519 AAAAC3NzaCetcetera/etceteraJZMfk3QPfQ foo@bar" + ]; }; keyFiles = mkOption { From dab747106e20268e6d3a7c1a758185bc75507bef Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 15 Jun 2021 12:23:09 +0200 Subject: [PATCH 2/2] nixos/ssh: Document authorizedKeysFiles properly --- nixos/modules/services/networking/ssh/sshd.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index 87418a1bf219..227dfe834b29 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -256,7 +256,17 @@ in authorizedKeysFiles = mkOption { type = types.listOf types.str; default = []; - description = "Files from which authorized keys are read."; + description = '' + Specify the rules for which files to read on the host. + + This is an advanced option. If you're looking to configure user + keys, you can generally use + or . + + These are paths relative to the host root file system or home + directories and they are subject to certain token expansion rules. + See AuthorizedKeysFile in man sshd_config for details. + ''; }; authorizedKeysCommand = mkOption {