Ports: Generate host keys for OpenSSH
This commit is contained in:
parent
e69b729733
commit
a6201f708e
Notes:
sideshowbarker
2024-07-18 18:49:43 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/a6201f708ee Pull-request: https://github.com/SerenityOS/serenity/pull/6777 Reviewed-by: https://github.com/awesomekling
1 changed files with 13 additions and 0 deletions
|
@ -17,4 +17,17 @@ pre_configure() {
|
|||
install() {
|
||||
# Can't make keys outside of Serenity since ssh-keygen is built for Serenity.
|
||||
run make DESTDIR="${SERENITY_INSTALL_ROOT}" $installopts install-nokeys
|
||||
|
||||
if command -v ssh-keygen &>/dev/null; then
|
||||
mkdir -p "${SERENITY_INSTALL_ROOT}/etc/ssh"
|
||||
if [ ! -e "${SERENITY_INSTALL_ROOT}/etc/ssh/ssh_host_rsa_key" ]; then
|
||||
ssh-keygen -f "${SERENITY_INSTALL_ROOT}/etc/ssh/ssh_host_rsa_key" -C serenity -N "" -t rsa
|
||||
fi
|
||||
if [ ! -e "${SERENITY_INSTALL_ROOT}/etc/ssh/ssh_host_dsa_key" ]; then
|
||||
ssh-keygen -f "${SERENITY_INSTALL_ROOT}/etc/ssh/ssh_host_dsa_key" -C serenity -N "" -t dsa
|
||||
fi
|
||||
if [ ! -e "${SERENITY_INSTALL_ROOT}/etc/ssh/ssh_host_ecdsa_key" ]; then
|
||||
ssh-keygen -f "${SERENITY_INSTALL_ROOT}/etc/ssh/ssh_host_ecdsa_key" -C serenity -N "" -t ecdsa -b 521
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue