SSH shenanigans

This commit is contained in:
2024-02-05 11:38:43 +01:00
parent 0f9aaa2d5c
commit 31be89f044
4 changed files with 34 additions and 49 deletions

View File

@@ -31,55 +31,43 @@
enable = true;
};
services.fail2ban.enable = true;
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
containers."jumphost" = {
autoStart = true;
privateNetwork = true;
hostBridge = "br0";
config = {config, pkgs, lib, ... }: {
networking.useDHCP = lib.mkForce true;
services.endlessh = {
enable = true;
port = 22;
openFirewall = true;
};
services.openssh = {
enable = true;
ports = [ 2022 ];
settings.PasswordAuthentication = false;
};
users.users."jump" = {
name = "jump";
isNormalUser = true;
};
};
};
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# sound.enable = true;
# hardware.pulseaudio.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
# users.users.alice = {
# isNormalUser = true;
# extraGroups = [ "wheel" ]; # Enable sudo for the user.
# packages = with pkgs; [
# firefox
# tree
# ];
# };
# List packages installed in system profile. To search, run:
# $ nix search wget
# environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
# ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
networking.firewall.allowedTCPPorts = [ 53589 ];
networking.firewall.allowedUDPPorts = [ 9200 ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
networking.firewall.enable = true;
networking = {
bridges.br0.interfaces = [ "ens3" ];
useDHCP = false;
interfaces."br0".useDHCP = true;
};
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you