add ssh
This commit is contained in:
parent
c2d6818744
commit
96e4afa3eb
1 changed files with 23 additions and 1 deletions
|
|
@ -9,9 +9,10 @@
|
|||
vim # or some other editor, e.g. nano or neovim
|
||||
|
||||
# Some common stuff that people expect to have
|
||||
#procps
|
||||
procps
|
||||
#killall
|
||||
#diffutils
|
||||
inetutils
|
||||
findutils
|
||||
utillinux
|
||||
tzdata
|
||||
|
|
@ -34,6 +35,10 @@
|
|||
openssh
|
||||
just
|
||||
nh
|
||||
(pkgs.writeShellScriptBin "sshd-start" ''
|
||||
echo "Starting sshd on port 8022"
|
||||
${pkgs.openssh}/bin/sshd
|
||||
'')
|
||||
];
|
||||
|
||||
# Backup etc files instead of failing to activate generation if a file already exists in /etc
|
||||
|
|
@ -49,4 +54,21 @@
|
|||
|
||||
# Set your time zone
|
||||
#time.timeZone = "Europe/Berlin";
|
||||
|
||||
build.activation.sshd = ''
|
||||
if [ ! -e /etc/ssh/ssh_host_rsa_key ]; then
|
||||
$VERBOSE_ECHO "Generating host keys..."
|
||||
$DRY_RUN_CMD ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -a 32 -f "/etc/ssh/ssh_host_ed25519_key" -N ""
|
||||
fi
|
||||
'';
|
||||
|
||||
environment.etc."ssh/sshd_config".text = ''
|
||||
AcceptEnv LANG LC_*
|
||||
KbdInteractiveAuthentication no
|
||||
PasswordAuthentication no
|
||||
PermitRootLogin no
|
||||
Port 8022
|
||||
PrintMotd no
|
||||
'';
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue