diff options
author | Daniil Baturin <daniil@baturin.org> | 2025-03-17 18:09:47 +0000 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2025-03-17 18:09:47 +0000 |
commit | 2fa104b708ffb0079a840d0c72a6e61c7d146080 (patch) | |
tree | 2e0308809652b21a8a8383df81e6f872b4acc3e8 /src/conf_mode | |
parent | aeb25214ecddab10953b322fc39bc4dc09b15ed5 (diff) | |
download | vyos-1x-2fa104b708ffb0079a840d0c72a6e61c7d146080.tar.gz vyos-1x-2fa104b708ffb0079a840d0c72a6e61c7d146080.zip |
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') |