Skip to content

Commit

Permalink
generate all key types
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Fisher committed Dec 1, 2024
1 parent 18744d0 commit ba88cbf
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/brand/ipkg/system-unconfigure
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,15 @@ reset_ssh_config() {
|| bomb "Failed to update PermitRootLogin in $f"
fi
echo "------ Generating new ssh host keys"
for algo in rsa ecdsa; do
for algo in rsa ecdsa ed25519; do
[ -f $ALTROOT/etc/ssh/ssh_host_${algo}_key ] \
&& mv $ALTROOT/etc/ssh/ssh_host_${algo}_key{,.old}
[ -f $ALTROOT/etc/ssh/ssh_host_${algo}_key.pub ] \
&& mv $ALTROOT/etc/ssh/ssh_host_${algo}_key.pub{,.old}
done
/usr/bin/ssh-keygen -q -t rsa -b 2048 -N '' -C root@unknown \
/usr/bin/ssh-keygen -q -A -C root@unknown \
-f $ALTROOT/etc/ssh/ssh_host_rsa_key \
|| bomb "Failed to create new $ALTROOT/etc/ssh/ssh_host_rsa_key"
/usr/bin/ssh-keygen -q -t ecdsa -b 521 -N '' -C root@unknown \
-f $ALTROOT/etc/ssh/ssh_host_ecdsa_key \
|| bomb "Failed to create new $ALTROOT/etc/ssh/ssh_host_dsa_key"
|| bomb "Failed to create new $ALTROOT/etc/ssh/ssh_host_*_key"
rm -f $ALTROOT/etc/ssh/ssh_host_*.old \
|| bomb "Failed to remove old key files"
}
Expand Down

0 comments on commit ba88cbf

Please sign in to comment.