diff -Nur e-smith-openssh-2.6.0.old/createlinks e-smith-openssh-2.6.0/createlinks --- e-smith-openssh-2.6.0.old/createlinks 2013-02-13 18:00:35.000000000 -0500 +++ e-smith-openssh-2.6.0/createlinks 2020-12-11 15:30:31.663000000 -0500 @@ -12,6 +12,7 @@ console-save bootstrap-console-save remoteaccess-update + e-smith-openssh-update )); } @@ -27,13 +28,16 @@ user-create user-delete user-modify + e-smith-openssh-update )); } foreach my $event ( "console-save", "bootstrap-console-save", - "remoteaccess-update") + "remoteaccess-update", + "e-smith-openssh-update" +) { event_link("sshd-conf", $event, "65"); } @@ -42,12 +46,12 @@ "console-save", "remoteaccess-update") { - safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/sshd"); + safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/sshd"); } -# Set up links to daemontools. Note: /etc/init.d/sshd is now obsolete. -safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/sshd"); +$event="e-smith-openssh-update"; +# systemd-specific action mandatory for this package-update event +event_link("systemd-reload", $event, "89"); +event_link("systemd-default", $event, "88"); +safe_symlink("try-restart", "root/etc/e-smith/events/$event/services2adjust/sshd"); -service_link_enhanced("sshd", "S85", "7"); -safe_symlink("../init.d/supervise/sshd", "root/etc/rc.d/rc6.d/K25sshd"); -safe_symlink("../init.d/supervise/sshd", "root/etc/rc.d/rc0.d/K25sshd"); diff -Nur e-smith-openssh-2.6.0.old/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyECDSA e-smith-openssh-2.6.0/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyECDSA --- e-smith-openssh-2.6.0.old/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyECDSA 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-openssh-2.6.0/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyECDSA 2020-12-11 15:39:26.040000000 -0500 @@ -0,0 +1 @@ +HostKey /etc/ssh/ssh_host_ecdsa_key diff -Nur e-smith-openssh-2.6.0.old/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyED25519 e-smith-openssh-2.6.0/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyED25519 --- e-smith-openssh-2.6.0.old/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyED25519 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-openssh-2.6.0/root/etc/e-smith/templates/etc/ssh/sshd_config/20HostKeyED25519 2020-12-11 15:39:49.597000000 -0500 @@ -0,0 +1,2 @@ +HostKey /etc/ssh/ssh_host_ed25519_key + diff -Nur e-smith-openssh-2.6.0.old/root/sbin/e-smith/systemd/sshd-prepare e-smith-openssh-2.6.0/root/sbin/e-smith/systemd/sshd-prepare --- e-smith-openssh-2.6.0.old/root/sbin/e-smith/systemd/sshd-prepare 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-openssh-2.6.0/root/sbin/e-smith/systemd/sshd-prepare 2020-12-11 15:20:35.831000000 -0500 @@ -0,0 +1,97 @@ +#!/bin/sh + +# Generate host keys if they are not already present. Taken from sshd +# initscript. +KEYGEN=/usr/bin/ssh-keygen +SSHD=/usr/sbin/sshd +RSA1_KEY=/etc/ssh/ssh_host_key +RSA_KEY=/etc/ssh/ssh_host_rsa_key +DSA_KEY=/etc/ssh/ssh_host_dsa_key +ECDSA_KEY=/etc/ssh/ssh_host_ecdsa_key +ED25519_KEY=/etc/ssh/ssh_host_ed25519_key + +do_rsa1_keygen() { + if [ ! -s $RSA1_KEY ]; then + echo -n $"Generating SSH1 RSA host key: " + if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then + chmod 600 $RSA1_KEY + chmod 644 $RSA1_KEY.pub + echo "Success: RSA1 key generation" + echo + else + echo "Failure: RSA1 key generation" + echo + exit 1 + fi + fi +} + +do_rsa_keygen() { + if [ ! -s $RSA_KEY ]; then + echo -n $"Generating SSH2 RSA host key: " + if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then + chmod 600 $RSA_KEY + chmod 644 $RSA_KEY.pub + echo "Success: RSA key generation" + echo + else + echo "Failure: RSA key generation" + echo + exit 1 + fi + fi +} +do_dsa_keygen() { + if [ ! -s $DSA_KEY ]; then + echo -n $"Generating SSH2 DSA host key: " + if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then + chmod 600 $DSA_KEY + chmod 644 $DSA_KEY.pub + echo "Success: DSA key generation" + echo + else + echo "Failure: DSA key generation" + echo + exit 1 + fi + fi +} + +do_ecdsa_keygen() { + if [ ! -s $ECDSA_KEY ]; then + echo -n $"Generating SSH2 ECDSA host key: " + if $KEYGEN -q -t ecdsa -f $ECDSA_KEY -C '' -N '' >&/dev/null; then + chmod 600 $ECDSA_KEY + chmod 644 $ECDSA_KEY.pub + echo "Success: ECDSA key generation" + echo + else + echo "Failure: ECDSA key generation" + echo + exit 1 + fi + fi +} + +do_ed25519_keygen() { + if [ ! -s $ED25519_KEY ]; then + echo -n $"Generating SSH2 ED25519 host key: " + if $KEYGEN -q -t ed25519 -f $ED25519_KEY -C '' -N '' >&/dev/null; then + chmod 600 $ED25519_KEY + chmod 644 $ED25519_KEY.pub + echo "Success: ED25519 key generation" + echo + else + echo "Failure: ED25519 key generation" + echo + exit 1 + fi + fi +} + +do_rsa1_keygen +do_rsa_keygen +do_dsa_keygen +do_ecdsa_keygen +do_ed25519_keygen +exit 0; diff -Nur e-smith-openssh-2.6.0.old/root/usr/lib/systemd/system/sshd.service.d/50-koozali.conf e-smith-openssh-2.6.0/root/usr/lib/systemd/system/sshd.service.d/50-koozali.conf --- e-smith-openssh-2.6.0.old/root/usr/lib/systemd/system/sshd.service.d/50-koozali.conf 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-openssh-2.6.0/root/usr/lib/systemd/system/sshd.service.d/50-koozali.conf 2020-12-11 15:25:37.919000000 -0500 @@ -0,0 +1,6 @@ +[Service] +ExecStartPre=/sbin/e-smith/service-status sshd +ExecStartPre=/sbin/e-smith/systemd/sshd-prepare + +[Install] +WantedBy=sme-server.target