46 lines
1.3 KiB
Bash
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.4"
|
|
export DEP_conf_ssh="upgrade_dist"
|
|
|
|
conf_ssh()
|
|
{
|
|
prnt I "Installing OpenSSH server..."
|
|
pkginst openssh-server
|
|
|
|
prnt I "Stopping SSH server service..."
|
|
svc_stop ssh
|
|
|
|
prnt I "Installating OpenSSH configuration files..."
|
|
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 "Starting SSH server service..."
|
|
svc_start ssh
|
|
}
|
|
|
|
precheck_conf_ssh()
|
|
{
|
|
file_must_exists ssh/ssh{,d}_config
|
|
}
|
|
|
|
export -f conf_ssh
|
|
export -f precheck_conf_ssh
|
|
|
|
# EOF
|