openssh-server: use ssh-keygen -A to replace the systemd helper script.
This commit is contained in:
parent
7f47f9fa89
commit
895c12e522
4 changed files with 3 additions and 25 deletions
|
@ -1,16 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ ! -e /etc/ssh/ssh_host_key ]; then
|
|
||||||
/usr/bin/ssh-keygen -t rsa1 -b 4096 -f /etc/ssh/ssh_host_key -N ''
|
|
||||||
fi
|
|
||||||
if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
|
|
||||||
/usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N ''
|
|
||||||
fi
|
|
||||||
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
|
|
||||||
/usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
|
|
||||||
fi
|
|
||||||
if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then
|
|
||||||
/usr/bin/ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,12 +1,9 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=OpenSSH server Key Generation
|
Description=OpenSSH server Key Generation
|
||||||
ConditionPathExists=|!/etc/ssh/ssh_host_key
|
|
||||||
ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
|
|
||||||
ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key
|
|
||||||
ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/lib/systemd/scripts/sshdgenkeys
|
Type=oneshot
|
||||||
|
ExecStart=/usr/bin/ssh-keygen -A
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -5,7 +5,7 @@ long_desc="${long_desc}
|
||||||
|
|
||||||
This package contains the ${pkgname} server files."
|
This package contains the ${pkgname} server files."
|
||||||
|
|
||||||
revision=1
|
revision=2
|
||||||
|
|
||||||
conf_files="/etc/ssh/sshd_config /etc/pam.d/sshd"
|
conf_files="/etc/ssh/sshd_config /etc/pam.d/sshd"
|
||||||
systemd_services="sshd.service sshdgenkeys.service"
|
systemd_services="sshd.service sshdgenkeys.service"
|
||||||
|
@ -31,7 +31,5 @@ do_install()
|
||||||
vmove etc/pam.d etc
|
vmove etc/pam.d etc
|
||||||
vinstall ${FILESDIR}/sshd.service 644 lib/systemd/system
|
vinstall ${FILESDIR}/sshd.service 644 lib/systemd/system
|
||||||
vinstall ${FILESDIR}/sshdgenkeys.service 644 lib/systemd/system
|
vinstall ${FILESDIR}/sshdgenkeys.service 644 lib/systemd/system
|
||||||
vinstall ${FILESDIR}/sshdgenkeys.scripts 755 \
|
|
||||||
lib/systemd/scripts sshdgenkeys
|
|
||||||
vinstall ${FILESDIR}/sshd.tmpfiles.d 644 usr/lib/tmpfiles.d sshd.conf
|
vinstall ${FILESDIR}/sshd.tmpfiles.d 644 usr/lib/tmpfiles.d sshd.conf
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,6 @@ post_install()
|
||||||
vinstall contrib/findssl.sh 755 usr/bin findssl
|
vinstall contrib/findssl.sh 755 usr/bin findssl
|
||||||
vinstall contrib/ssh-copy-id 755 usr/bin
|
vinstall contrib/ssh-copy-id 755 usr/bin
|
||||||
vinstall contrib/ssh-copy-id.1 644 usr/share/man/man1
|
vinstall contrib/ssh-copy-id.1 644 usr/share/man/man1
|
||||||
vinstall ${FILESDIR}/sshd.rc 755 etc/init.d sshd
|
|
||||||
vinstall LICENCE 644 usr/share/licenses/${pkgname}
|
vinstall LICENCE 644 usr/share/licenses/${pkgname}
|
||||||
|
|
||||||
sed -i \
|
sed -i \
|
||||||
|
|
Loading…
Reference in a new issue