Fixes following tests (some sshd_config options do not exists or are deprecated)

This commit is contained in:
Alexandre Aubin 2018-11-28 17:50:20 +00:00
parent fad4ff090a
commit 3d81f032e9
4 changed files with 10 additions and 16 deletions

View file

@ -272,6 +272,7 @@ ynh_local_curl () {
ynh_render_template() {
local template_path=$1
local output_path=$2
mkdir -p "$(dirname $output_path)"
# Taken from https://stackoverflow.com/a/35009576
python2.7 -c 'import os, sys, jinja2; sys.stdout.write(
jinja2.Template(sys.stdin.read()

View file

@ -21,7 +21,7 @@ do_pre_regen() {
ssh_keys="$ssh_keys $(ls /etc/ssh/ssh_host_dsa_key 2>/dev/null)"
fi
export $ssh_keys
export ssh_keys
ynh_render_template "sshd_config" "${pending_dir}/etc/ssh/sshd_config"
fi
}

View file

@ -1,16 +1,14 @@
# Package generated configuration file
# See the sshd_config(5) manpage for details
# This configuration has been automatically generated
# by YunoHost
# What ports, IPs and protocols we listen for
Protocol 2
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
ListenAddress ::
ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
{% for key in ssh_keys %}
HostKey {{ key }}
{% endfor %}
{% for key in ssh_keys.split() %}
HostKey {{ key }}{% endfor %}
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
@ -24,14 +22,11 @@ LoginGraceTime 120
PermitRootLogin no
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
@ -92,5 +87,3 @@ Match User sftpusers
AllowTcpForwarding no
GatewayPorts no
X11Forwarding no
Include sshd_config.d/*

View file

@ -65,7 +65,7 @@ class MyMigration(Migration):
copyfile('/etc/ssh/sshd_config.bkp', SSHD_CONF)
# If we detect the conf as manually modified
ynh_hash = _get_conf_hashes('ssh')[SSHD_CONF]
ynh_hash = _get_conf_hashes('ssh').get(SSHD_CONF, None)
current_hash = _calculate_hash(SSHD_CONF)
if ynh_hash != current_hash: