Skip to content
Snippets Groups Projects
Commit bab803d3 authored by Adam Wujek's avatar Adam Wujek
Browse files

[FEATURE: #190] rootfs/etc/init.d/sshd.sh: preserve ssh keys over firmware updates


Signed-off-by: default avatarAdam Wujek <dev_public@wujek.eu>
parent 0bbad8cb
Branches
Tags
No related merge requests found
......@@ -4,6 +4,7 @@
#
dotconfig=/wr/etc/dot-config
permanent_path_ssh=/update/permanent/ssh
# Make sure the ssh-keygen progam exists
[ -f /usr/bin/ssh-keygen ] || exit 0
......@@ -37,7 +38,11 @@ start() {
# Make sure ssh directory exists
mkdir -p /etc/ssh
mkdir -p /usr/etc/ssh
if [ -d "$permanent_path_ssh" ] ; then
cp "$permanent_path_ssh"/ssh_host_*_key* /etc/ssh/
fi
# Check for the ssh keys
if [ ! -f /etc/ssh/ssh_host_rsa_key ] \
|| [ ! -f /etc/ssh/ssh_host_dsa_key ] \
......@@ -45,7 +50,8 @@ start() {
|| [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then
# echo -n "generating ssh keys... "
/usr/bin/ssh-keygen -A
cp /etc/ssh/ssh_host_*_key* /usr/etc/ssh
mkdir -p "$permanent_path_ssh"
cp /etc/ssh/ssh_host_*_key* "$permanent_path_ssh"
fi
if [ "$CONFIG_ROOT_ACCESS_DISABLE" = "y" ]; then
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment