ssh port config

This commit is contained in:
Daniel Langbein 2023-09-15 21:08:53 +02:00
parent 042d9fb30e
commit 193d7d0cd3
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
5 changed files with 12 additions and 3 deletions

View File

@ -48,4 +48,6 @@ in
]; ];
networking.hostName = "yodaTab"; networking.hostName = "yodaTab";
services.openssh.ports = [ 22 ];
boot.initrd.network.ssh.port = 22;
} }

View File

@ -6,6 +6,7 @@
let let
# Import Home Manager with niv. # Import Home Manager with niv.
home-manager = (import ../../nix/sources.nix).home-manager; home-manager = (import ../../nix/sources.nix).home-manager;
#home-manager-source = import (import ../../nix/sources.nix).home-manager {};
in in
{ {
# Paths to other modules. # Paths to other modules.
@ -17,6 +18,7 @@ in
./hardware-configuration.nix ./hardware-configuration.nix
# Home Manager. # Home Manager.
(import "${home-manager}/nixos") (import "${home-manager}/nixos")
#home-manager-source.nixos
../../modules/home-manager.nix ../../modules/home-manager.nix
# NUR. # NUR.
../../modules/nur.nix ../../modules/nur.nix
@ -48,4 +50,6 @@ in
]; ];
networking.hostName = "yodaTux"; networking.hostName = "yodaTux";
services.openssh.ports = [ 22 ];
boot.initrd.network.ssh.port = 22;
} }

View File

@ -50,4 +50,6 @@ in
]; ];
networking.hostName = "yodaYoga"; networking.hostName = "yodaYoga";
services.openssh.ports = [ 2223 ];
boot.initrd.network.ssh.port = 2223;
} }

View File

@ -11,7 +11,7 @@
boot.initrd.network.enable = true; boot.initrd.network.enable = true;
boot.initrd.network.ssh = { boot.initrd.network.ssh = {
enable = true; enable = true;
port = 22; #port = 22;
shell = "/bin/cryptsetup-askpass"; shell = "/bin/cryptsetup-askpass";
authorizedKeys = [ authorizedKeys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCpgihAg8Qzu5q+AGXHLR7p+rrS1yB0KlZb/Y/EwZT15EhEtsUMqBMRiY0TdjKQU0broyygZnymccLmCXvihEgk3zk/hP8VEDmN5wmE2tRBPR4lSjo8E1R8N79G+gaFkwi93QYh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eOIOD/i7G1Mjx7Dj2ctnT/ILat/xsf+Y0W4eJr3bc5L9ghgw6wsKbNSqwjFUCFcHcARK3gvSH+hO2/BpgMVoyvZjO5PNuUqfsZ7bIIs5cDdyB/ly3irKuaRz1+3x1x4gPgSiOcji7HxPwogzhPsyfoRLHNt9tJ5X4nF2Iz1M5RTJpbZCi6yEj+9Q85FVjD76BEWuZe18kRrwhuLf/XgKdF9tQ== openpgp:0xA8B75370"

View File

@ -4,6 +4,7 @@
# Enable SSH server. # Enable SSH server.
services.openssh = { services.openssh = {
enable = true; enable = true;
#ports = [ 22 ];
# Forbid root login through SSH. # Forbid root login through SSH.
settings.PermitRootLogin = "no"; settings.PermitRootLogin = "no";
# Use authorized keys only. # Use authorized keys only.
@ -27,13 +28,13 @@
"yodaYoga" = { "yodaYoga" = {
hostname = "192.168.178.99"; hostname = "192.168.178.99";
user = "yoda"; user = "yoda";
port = 22; port = 2223;
compression = false; compression = false;
}; };
"unlockYodaYoga" = { "unlockYodaYoga" = {
hostname = "192.168.178.99"; hostname = "192.168.178.99";
user = "root"; user = "root";
port = 22; port = 2223;
compression = false; compression = false;
}; };
"pi3bplus" = { "pi3bplus" = {