umorpha-boxes/modules/base-sshd.sh

22 lines
479 B
Bash
Raw Permalink Normal View History

2023-10-28 22:12:25 +00:00
#!/hint/bash -euE
# Copyright (C) 2023 Umorpha Systems
# SPDX-License-Identifier: AGPL-3.0-or-later
packages+=(openssh)
2023-11-04 07:12:33 +00:00
post_install+=(20:sshd:post_install)
2023-10-28 22:12:25 +00:00
sshd:post_install() {
local arg_mountpoint=$1
install -Dm644 /dev/stdin "$arg_mountpoint/etc/ssh/sshd_config.d/90-umorpha.conf" <<-EOF
2023-10-29 03:32:46 +00:00
UsePAM yes
2023-10-28 22:12:25 +00:00
PasswordAuthentication no
2023-10-29 03:32:46 +00:00
KbdInteractiveAuthentication no
2023-10-28 22:12:25 +00:00
PermitRootLogin no
AllowGroups users
EOF
systemctl --root="$arg_mountpoint" enable sshd.service
}