diff options
author | Christian Breunig <christian@breunig.cc> | 2025-03-17 20:29:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-17 20:29:58 +0100 |
commit | 95af91597c94856a38722daa5ea388646f9b735f (patch) | |
tree | 2e0308809652b21a8a8383df81e6f872b4acc3e8 /src/conf_mode | |
parent | aeb25214ecddab10953b322fc39bc4dc09b15ed5 (diff) | |
parent | 2fa104b708ffb0079a840d0c72a6e61c7d146080 (diff) | |
download | vyos-1x-95af91597c94856a38722daa5ea388646f9b735f.tar.gz vyos-1x-95af91597c94856a38722daa5ea388646f9b735f.zip |
Merge pull request #4401 from dmbaturin/T7217-generate-dropbear-keys
console-server: T7217: generate Dropbear SSH keys if they do not exist
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/service_console-server.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/conf_mode/service_console-server.py b/src/conf_mode/service_console-server.py index b112add3f..b83c6dfb1 100755 --- a/src/conf_mode/service_console-server.py +++ b/src/conf_mode/service_console-server.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2018-2021 VyOS maintainers and contributors +# Copyright (C) 2018-2025 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -98,6 +98,12 @@ def generate(proxy): return None def apply(proxy): + if not os.path.exists('/etc/dropbear/dropbear_rsa_host_key'): + call('dropbearkey -t rsa -s 4096 -f /etc/dropbear/dropbear_rsa_host_key') + + if not os.path.exists('/etc/dropbear/dropbear_ecdsa_host_key'): + call('dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key') + call('systemctl daemon-reload') call('systemctl stop dropbear@*.service conserver-server.service') |