Skip to content

Commit

Permalink
fix host key not written to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
pomdtr committed Feb 2, 2025
1 parent 9850419 commit 74c66e8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,14 @@ func NewCmdUp() *cobra.Command {
},
}

hostKeyPath := flags.sshHostKey
if !utils.FileExists(hostKeyPath) {
_, err := keygen.New(flags.sshHostKey)
if !utils.FileExists(flags.sshHostKey) {
_, err := keygen.New(flags.sshHostKey, keygen.WithWrite())
if err != nil {
return fmt.Errorf("failed to generate host key: %v", err)
}
}

server.SetOption(ssh.HostKeyFile(hostKeyPath))
server.SetOption(ssh.HostKeyFile(flags.sshHostKey))

listener, err := getListener(flags.sshAddr, "", "")
if err != nil {
Expand Down

0 comments on commit 74c66e8

Please sign in to comment.