2401590e48
- Add systemd startup units OBS-URL: https://build.opensuse.org/request/show/94377 OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=16
22 lines
994 B
Bash
22 lines
994 B
Bash
#!/bin/bash
|
|
|
|
if ! grep -q '^[[:space:]]*HostKey[[:space:]]' /etc/ssh/sshd_config; then
|
|
if ! test -f /etc/ssh/ssh_host_key ; then
|
|
echo Generating /etc/ssh/ssh_host_key.
|
|
ssh-keygen -t rsa1 -b 2048 -f /etc/ssh/ssh_host_key -N ''
|
|
fi
|
|
if ! test -f /etc/ssh/ssh_host_dsa_key ; then
|
|
echo Generating /etc/ssh/ssh_host_dsa_key.
|
|
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
|
|
fi
|
|
if ! test -f /etc/ssh/ssh_host_rsa_key ; then
|
|
echo Generating /etc/ssh/ssh_host_rsa_key.
|
|
ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N ''
|
|
fi
|
|
if ! test -f /etc/ssh/ssh_host_ecdsa_key ; then
|
|
echo Generating /etc/ssh/ssh_host_ecdsa_key.
|
|
ssh-keygen -t ecdsa -b 256 -f /etc/ssh/ssh_host_ecdsa_key -N ''
|
|
fi
|
|
fi
|
|
|