enable root SSH key-only login for deploy-rs
- Change PermitRootLogin from 'no' to 'prohibit-password' (key-only) - Add forgejo-deploy public key to root's authorized_keys - Revert deploy-rs user back to root (needs root for activation) Root can only login via SSH key, password auth remains disabled.
This commit is contained in:
parent
3f07d27c78
commit
92abe2574d
3 changed files with 7 additions and 3 deletions
|
|
@ -128,8 +128,7 @@
|
||||||
"2299"
|
"2299"
|
||||||
];
|
];
|
||||||
profiles.system = {
|
profiles.system = {
|
||||||
user = "steffen";
|
user = "root";
|
||||||
sshUser = "steffen";
|
|
||||||
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cryodev-main;
|
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cryodev-main;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,9 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Root SSH key for deploy-rs (key-only, no password)
|
||||||
|
users.users.root.openssh.authorizedKeys.keyFiles = [
|
||||||
|
../../../users/steffen/pubkeys/forgejo-deploy.pub
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ in
|
||||||
ports = mkDefault [ 2299 ];
|
ports = mkDefault [ 2299 ];
|
||||||
openFirewall = mkDefault true;
|
openFirewall = mkDefault true;
|
||||||
settings = {
|
settings = {
|
||||||
PermitRootLogin = mkDefault "no";
|
PermitRootLogin = mkDefault "prohibit-password";
|
||||||
PasswordAuthentication = mkDefault false;
|
PasswordAuthentication = mkDefault false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue