diff options
author | Takeru Hayasaka <hayatake396@gmail.com> | 2024-12-21 03:33:51 +0000 |
---|---|---|
committer | Takeru Hayasaka <hayatake396@gmail.com> | 2024-12-23 09:13:14 +0000 |
commit | 8b560e7ef40b7c80c2556f111639eb4213d2c0aa (patch) | |
tree | 73dc25b3c22ac2d88d186eaaf221c74cb5e48513 | |
parent | 967218a33cda789758822f9f1232dffce3ddddca (diff) | |
download | vyos-1x-8b560e7ef40b7c80c2556f111639eb4213d2c0aa.tar.gz vyos-1x-8b560e7ef40b7c80c2556f111639eb4213d2c0aa.zip |
T6013: Remove trusted_user_ca_key when the configuration does not exist
Co-authored-by: Simon <965089+sarthurdev@users.noreply.github.com>
-rwxr-xr-x | src/conf_mode/service_ssh.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/conf_mode/service_ssh.py b/src/conf_mode/service_ssh.py index 74d962876..759f87bb2 100755 --- a/src/conf_mode/service_ssh.py +++ b/src/conf_mode/service_ssh.py @@ -134,6 +134,8 @@ def generate(ssh): write_file( trusted_user_ca_key, '\n'.join(encode_certificate(c) for c in ca_full_chain) ) + elif os.path.exists(trusted_user_ca_key): + os.unlink(trusted_user_ca_key) render(config_file, 'ssh/sshd_config.j2', ssh) |