umorpha-boxes/modules/sshd.sh

19 lines
431 B
Bash
Raw 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)
post_install+=(01:sshd:post_install)
sshd:post_install() {
local arg_mountpoint=$1
install -Dm644 /dev/stdin "$arg_mountpoint/etc/ssh/sshd_config.d/90-umorpha.conf" <<-EOF
PasswordAuthentication no
PermitRootLogin no
AllowGroups users
EOF
systemctl --root="$arg_mountpoint" enable sshd.service
}