feat(rpi4): switch to key authentication for openssh
This commit is contained in:
parent
288ad32856
commit
24c63b4375
1
key
Normal file
1
key
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIINDTp/k2m9yUn8NGDpCzyX2iK9lOwe6lJR5sk19apxC openpgp:0xBBA675EA
|
14
rpi4.nix
14
rpi4.nix
|
@ -1,5 +1,6 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
with builtins;
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# ./hardware/base.nix
|
# ./hardware/base.nix
|
||||||
|
@ -64,12 +65,23 @@
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
challengeResponseAuthentication = false;
|
||||||
|
passwordAuthentication = false;
|
||||||
|
permitRootLogin = "no";
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.initrd.network.ssh = {
|
||||||
|
enable = true;
|
||||||
|
authorizedKeys = [(readFile "./key")];
|
||||||
|
};
|
||||||
|
|
||||||
users.users.felschr = {
|
users.users.felschr = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [ "wheel" "audio" "disk" ];
|
extraGroups = [ "wheel" "audio" "disk" ];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
|
openssh.authorizedKeys.keyFiles = [ ./key ];
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
|
|
Loading…
Reference in a new issue