* Use the moduli file. This shuts up the "WARNING: /etc/ssh/moduli
does not exist, using fixed modulus" message in /var/log/messages. svn path=/nixos/trunk/; revision=19754
This commit is contained in:
parent
86b42fdfbf
commit
051e9342b3
@ -1,8 +1,9 @@
|
|||||||
{pkgs, config, ...}:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs.lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (pkgs.lib) mkOption mkIf;
|
|
||||||
inherit (pkgs) openssh;
|
inherit (pkgs) openssh;
|
||||||
|
|
||||||
cfg = config.services.sshd;
|
cfg = config.services.sshd;
|
||||||
@ -15,7 +16,7 @@ let
|
|||||||
|
|
||||||
UsePAM yes
|
UsePAM yes
|
||||||
|
|
||||||
${ pkgs.lib.concatMapStrings (port : ''Port ${toString port}
|
${ concatMapStrings (port : ''Port ${toString port}
|
||||||
'') cfg.ports}
|
'') cfg.ports}
|
||||||
|
|
||||||
${if cfg.forwardX11 then "
|
${if cfg.forwardX11 then "
|
||||||
@ -112,13 +113,18 @@ in
|
|||||||
|
|
||||||
config = mkIf config.services.sshd.enable {
|
config = mkIf config.services.sshd.enable {
|
||||||
|
|
||||||
users.extraUsers = pkgs.lib.singleton
|
users.extraUsers = singleton
|
||||||
{ name = "sshd";
|
{ name = "sshd";
|
||||||
uid = config.ids.uids.sshd;
|
uid = config.ids.uids.sshd;
|
||||||
description = "SSH privilege separation user";
|
description = "SSH privilege separation user";
|
||||||
home = "/var/empty";
|
home = "/var/empty";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.etc = singleton
|
||||||
|
{ source = "${openssh}/etc/ssh/moduli";
|
||||||
|
target = "ssh/moduli";
|
||||||
|
};
|
||||||
|
|
||||||
jobs.sshd = {
|
jobs.sshd = {
|
||||||
|
|
||||||
description = "OpenSSH server";
|
description = "OpenSSH server";
|
||||||
@ -141,7 +147,7 @@ in
|
|||||||
exec = "${openssh}/sbin/sshd -h /etc/ssh/ssh_host_dsa_key -f ${sshdConfig}";
|
exec = "${openssh}/sbin/sshd -h /etc/ssh/ssh_host_dsa_key -f ${sshdConfig}";
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = cfg.ports ;
|
networking.firewall.allowedTCPPorts = cfg.ports;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user