Skip to content

Commit

Permalink
openssh: support prohibit-password for permitRootLogin
Browse files Browse the repository at this point in the history
See openssh/openssh-portable@1dc8d93

I also made it the default.
  • Loading branch information
nhooyr committed Oct 1, 2016
1 parent 98a8146 commit 6891bb1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions nixos/modules/services/networking/ssh/sshd.nix
Expand Up @@ -102,8 +102,8 @@ in
};

permitRootLogin = mkOption {
default = "without-password";
type = types.enum ["yes" "without-password" "forced-commands-only" "no"];
default = "prohibit-password";
type = types.enum ["yes" "without-password" "prohibit-password" "forced-commands-only" "no"];
description = ''
Whether the root user can login using ssh.
'';
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/amazon-image.nix
Expand Up @@ -138,7 +138,7 @@ let cfg = config.ec2; in
# Allow root logins only using the SSH key that the user specified
# at instance creation time.
services.openssh.enable = true;
services.openssh.permitRootLogin = "without-password";
services.openssh.permitRootLogin = "prohibit-password";

# Force getting the hostname from EC2.
networking.hostName = mkDefault "";
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/azure-common.nix
Expand Up @@ -24,7 +24,7 @@ with lib;
# Allow root logins only using the SSH key that the user specified
# at instance creation time, ping client connections to avoid timeouts
services.openssh.enable = true;
services.openssh.permitRootLogin = "without-password";
services.openssh.permitRootLogin = "prohibit-password";
services.openssh.extraConfig = ''
ClientAliveInterval 180
'';
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/brightbox-image.nix
Expand Up @@ -103,7 +103,7 @@ in
# Allow root logins only using the SSH key that the user specified
# at instance creation time.
services.openssh.enable = true;
services.openssh.permitRootLogin = "without-password";
services.openssh.permitRootLogin = "prohibit-password";

# Force getting the hostname from Google Compute.
networking.hostName = mkDefault "";
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/google-compute-image.nix
Expand Up @@ -111,7 +111,7 @@ in
# Allow root logins only using the SSH key that the user specified
# at instance creation time.
services.openssh.enable = true;
services.openssh.permitRootLogin = "without-password";
services.openssh.permitRootLogin = "prohibit-password";
services.openssh.passwordAuthentication = mkDefault false;

# Force getting the hostname from Google Compute.
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/nova-image.nix
Expand Up @@ -31,7 +31,7 @@ with lib;

# Allow root logins
services.openssh.enable = true;
services.openssh.permitRootLogin = "without-password";
services.openssh.permitRootLogin = "prohibit-password";

# Put /tmp and /var on /ephemeral0, which has a lot more space.
# Unfortunately we can't do this with the `fileSystems' option
Expand Down

0 comments on commit 6891bb1

Please sign in to comment.