2024-05-12 19:58:55 +01:00
|
|
|
{ lib, config, ... }:
|
|
|
|
let
|
|
|
|
sshPort = 22;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
ports = [ sshPort ];
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
# Harden
|
|
|
|
PasswordAuthentication = true;
|
|
|
|
PermitRootLogin = "no";
|
|
|
|
# Automatically remove stale sockets
|
|
|
|
StreamLocalBindUnlink = "yes";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
2024-05-19 21:55:25 +01:00
|
|
|
programs.ssh.extraConfig = ''
|
|
|
|
Host git.bitlab21.com
|
|
|
|
IdentitiesOnly yes
|
|
|
|
StrictHostKeyChecking no
|
|
|
|
IdentityFile /etc/ssh/deploy_key-ssh-ed25519
|
|
|
|
'';
|
2024-05-12 19:58:55 +01:00
|
|
|
networking.firewall.allowedTCPPorts = [ sshPort ];
|
|
|
|
}
|