From 857ca84d9965e7bff39639a18c24466a291fbd9f Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Tue, 4 Apr 2023 12:53:46 -0400 Subject: [PATCH] fix(migrate): copy pub key --- cmd/soft/migrate_config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/soft/migrate_config.go b/cmd/soft/migrate_config.go index 200d46547d14c8d3894f0eb39b1ac7808f008715..e4731ab608bb1252b9786d0a995175157bc58387 100644 --- a/cmd/soft/migrate_config.go +++ b/cmd/soft/migrate_config.go @@ -52,6 +52,10 @@ var ( return fmt.Errorf("failed to copy ssh key: %w", err) } + if err := copyFile(keyPath+".pub", filepath.Join(cfg.DataPath, "ssh", filepath.Base(keyPath))+".pub"); err != nil { + log.Errorf("failed to copy ssh key: %s", err) + } + cfg.SSH.KeyPath = filepath.Join("ssh", filepath.Base(keyPath)) }