Files
init.sh/modules/conf_ssh.sh

46 lines
1.3 KiB
Bash

# ------------------------------------------------------------------------------
# Configure SSH client and server
# This file is part of the init.sh project
# Copyright (c) 2019-2021 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
# ------------------------------------------------------------------------------
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# https://opensource.org/licenses/BSD-3-Clause
# ------------------------------------------------------------------------------
# Variable:
# none
# ------------------------------------------------------------------------------
export VER_conf_ssh="0.1.2"
export DEP_conf_ssh="upgrade_dist"
conf_ssh()
{
prnt I "Installation du serveur OpenSSH..."
pkginst openssh-server
prnt I "Arrêt du service SSH..."
svc_stop ssh
prnt I "Installation des fichiers de configuration de SSH..."
for f in /etc/ssh/ssh{,d}_config; do
backup_dist $f
install_file ssh/$(basename $f) $f
tag_file $f
done
sed -i -e "s/@SSHD_PERMITROOT_RANGE@/$SSHD_PERMITROOT_RANGE/" /etc/ssh/sshd_config
prnt I "Démarrage du sevice ssh..."
svc_start ssh
}
precheck_conf_ssh()
{
file_must_exists ssh/ssh{,d}_config
}
export -f conf_ssh
export -f precheck_conf_ssh
# EOF