#!/bin/bash
# Filename:      ${GRML_FAI_CONFIG}/scripts/GRMLBASE/49-sshd
# Purpose:       adjust sshd configuration file
# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports:   see http://grml.org/bugs/
# License:       This file is licensed under the GPL v2 or any later version.
################################################################################

set -u
set -e

# FAI sets $target, but shellcheck does not know that.
target=${target:?}

if ! [ -r "${target}/etc/ssh/sshd_config" ] ; then
  echo "File /etc/ssh/sshd_config doesn't exist, skipping execution of script."
  exit 0
fi

echo "# Installed by grml-live.
# Ensure root login works. Modern openssh-servers default to prohibit-password.
PermitRootLogin yes
# Speedup if DNS is broken/unavailable.
UseDNS no
" > "${target}"/etc/ssh/sshd_config.d/grml-live.conf

## END OF FILE #################################################################
# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2
