mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-22 22:09:34 +01:00
23 lines
605 B
Nix
23 lines
605 B
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
# Enable SSH server.
|
|
services.openssh = {
|
|
enable = true;
|
|
#ports = [ 22 ];
|
|
# Use authorized keys only.
|
|
settings.PasswordAuthentication = false;
|
|
settings.PermitRootLogin = "prohibit-password";
|
|
# Enabling this is required for commands such as sftp and sshfs.
|
|
allowSFTP = false;
|
|
};
|
|
|
|
# SSH public key(s) allowed to connect via SSH.
|
|
users.users.yoda.openssh.authorizedKeys.keys = [
|
|
(builtins.readFile ../assets/ssh/nitrokey.pub)
|
|
];
|
|
users.users.root.openssh.authorizedKeys.keys = [
|
|
(builtins.readFile ../assets/ssh/nitrokey.pub)
|
|
];
|
|
}
|