lock down sshd on aristotle
This commit is contained in:
parent
56a120d0f1
commit
751704dae2
@ -4,6 +4,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
../../lappy-config
|
../../lappy-config
|
||||||
./paperless.nix
|
./paperless.nix
|
||||||
|
./sshd.nix
|
||||||
./agenix.nix
|
./agenix.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
@ -101,6 +102,7 @@
|
|||||||
ledger
|
ledger
|
||||||
gnuplot
|
gnuplot
|
||||||
anki-bin
|
anki-bin
|
||||||
|
x11vnc
|
||||||
|
|
||||||
# for the remote access functionality
|
# for the remote access functionality
|
||||||
vscode-fhs
|
vscode-fhs
|
||||||
@ -133,9 +135,5 @@
|
|||||||
wantedBy = []; # start only when I say so
|
wantedBy = []; # start only when I say so
|
||||||
};
|
};
|
||||||
|
|
||||||
# make sshd a `systemctl start sshd` command away
|
|
||||||
services.openssh.enable = true;
|
|
||||||
systemd.services.sshd.wantedBy = lib.mkForce [];
|
|
||||||
|
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
}
|
}
|
||||||
|
27
boxes/aristotle/sshd.nix
Normal file
27
boxes/aristotle/sshd.nix
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{ lib, machines, ... }:
|
||||||
|
{
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PermitRootLogin = "no";
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
};
|
||||||
|
listenAddresses = [
|
||||||
|
{
|
||||||
|
addr = "0.0.0.0";
|
||||||
|
port = 2222;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.usr.openssh.authorizedKeys.keys = with machines; [
|
||||||
|
copernicus.pubkey
|
||||||
|
aristotle.pubkey
|
||||||
|
phone.pubkey
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 2222 ];
|
||||||
|
|
||||||
|
# don't start the sshd immediately
|
||||||
|
systemd.services.sshd.wantedBy = lib.mkForce [];
|
||||||
|
}
|
@ -1,30 +1,18 @@
|
|||||||
Host mainsail
|
|
||||||
User usr
|
|
||||||
Port 22
|
|
||||||
|
|
||||||
Host phone
|
|
||||||
User u0_a193
|
|
||||||
Port 8022
|
|
||||||
|
|
||||||
Host netbox
|
Host netbox
|
||||||
HostName beepboop.systems
|
HostName beepboop.systems
|
||||||
User ryan
|
User ryan
|
||||||
Port 443
|
Port 443
|
||||||
|
|
||||||
Host mainsail-prox
|
Host copernicus-proxy
|
||||||
HostName localhost
|
HostName 10.100.0.2
|
||||||
User usr
|
|
||||||
Port 55554
|
|
||||||
ProxyJump netbox
|
|
||||||
|
|
||||||
Host mlg-prox
|
|
||||||
HostName localhost
|
|
||||||
User usr
|
User usr
|
||||||
Port 2222
|
Port 2222
|
||||||
ProxyJump mainsail-prox
|
ProxyJump netbox
|
||||||
|
|
||||||
Host x230t-prox
|
Host copernicus
|
||||||
HostName x230t
|
|
||||||
User usr
|
User usr
|
||||||
Port 22
|
Port 2222
|
||||||
ProxyJump mainsail-prox
|
|
||||||
|
Host aristotle
|
||||||
|
User usr
|
||||||
|
Port 2222
|
||||||
|
@ -12,3 +12,7 @@ Host copernicus-proxy
|
|||||||
Host copernicus
|
Host copernicus
|
||||||
User usr
|
User usr
|
||||||
Port 2222
|
Port 2222
|
||||||
|
|
||||||
|
Host aristotle
|
||||||
|
User usr
|
||||||
|
Port 2222
|
||||||
|
Loading…
Reference in New Issue
Block a user