summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2023-05-15 11:59:31 +0100
committerGitHub <noreply@github.com>2023-05-15 11:59:31 +0100
commit0dbf1c2fb1a5a0372a324eff1ba44f9da66febd2 (patch)
tree535d771ee4325f365365e9093a04e411fe2480e8 /tests
parent252541bd05a7f55f3704a3d014ad1badc1e3360d (diff)
parent3d22883cdb4226306be7583f5513b3ca23a72e24 (diff)
Merge pull request #654 from shivaraj-bh/authorized-keys
Manage SSH authorized keys for users
Diffstat (limited to 'tests')
-rw-r--r--tests/programs-ssh.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/programs-ssh.nix b/tests/programs-ssh.nix
index 71f285c..2928cfb 100644
--- a/tests/programs-ssh.nix
+++ b/tests/programs-ssh.nix
@@ -6,9 +6,15 @@
publicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==";
};
};
+ users.users.foo.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAA..." ];
test = ''
echo >&2 "checking for github.com in /etc/ssh/ssh_known_hosts"
grep 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' ${config.out}/etc/ssh/ssh_known_hosts
+
+ echo >&2 "checking for authorized keys for foo in /etc/ssh/authorized_keys.d/foo"
+ grep 'ssh-ed25519 AAAA...' ${config.out}/etc/ssh/authorized_keys.d/foo
+ echo >&2 "checking for authorized keys' path in /etc/ssh/sshd_config.d/101-authorized-keys.conf"
+ grep 'AuthorizedKeysFile /etc/ssh/authorized_keys.d/%u' ${config.out}/etc/ssh/sshd_config.d/101-authorized-keys.conf
'';
}