2015-03-28 20:33:17 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test -r /etc/sysconfig/config && . /etc/sysconfig/config
|
|
|
|
|
|
|
|
if test "$DROPBEAR" != "yes"; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2016-02-20 21:09:15 +01:00
|
|
|
if ! test -r /etc/dropbear/dropbear_rsa_host_key; then
|
2015-03-28 20:33:17 +01:00
|
|
|
mkdir -p /etc/dropbear
|
2016-02-20 21:09:15 +01:00
|
|
|
if test -r /etc/sysconfig/dropbear_rsa_host_key; then
|
|
|
|
cp /etc/sysconfig/dropbear_rsa_host_key /etc/dropbear/dropbear_rsa_host_key
|
2015-03-28 20:33:17 +01:00
|
|
|
else
|
2016-02-20 21:09:15 +01:00
|
|
|
dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
|
|
|
|
cp /etc/dropbear/dropbear_rsa_host_key /etc/sysconfig/dropbear_rsa_host_key
|
2015-03-28 20:33:17 +01:00
|
|
|
fi
|
|
|
|
fi
|
2016-02-20 21:09:15 +01:00
|
|
|
if test -r /etc/sysconfig/dropbear_dss_host_key; then
|
|
|
|
cp /etc/sysconfig/dropbear_dss_host_key /etc/dropbear/dropbear_dss_host_key
|
|
|
|
fi
|
2015-03-28 20:33:17 +01:00
|
|
|
export HOME=/root
|
|
|
|
if test -r /etc/sysconfig/authorized_keys ; then
|
|
|
|
mkdir -p $HOME/.ssh
|
|
|
|
cp /etc/sysconfig/authorized_keys $HOME/.ssh/authorized_keys
|
|
|
|
chmod 0600 $HOME/.ssh/authorized_keys
|
|
|
|
fi
|
2018-10-17 17:34:13 +02:00
|
|
|
exec dropbear -F
|