Merge pull request #2365 from afbjorklund/ssh-key-comment

Remove user@host from the lima ssh key
This commit is contained in:
Jan Dubois authored and GitHub committed 2024-05-26 22:59:47 -07:00
commit 3370b73e70
1 file changed
+3 -2
+3 -2
View File
@@ -63,8 +63,9 @@ func DefaultPubKeys(loadDotSSH bool) ([]PubKey, error) {
return nil, fmt.Errorf("could not create %q directory: %w", configDir, err)
}
if err := lockutil.WithDirLock(configDir, func() error {
keygenCmd := exec.Command("ssh-keygen", "-t", "ed25519", "-q", "-N", "", "-f",
filepath.Join(configDir, filenames.UserPrivateKey))
// no passphrase, no user@host comment
keygenCmd := exec.Command("ssh-keygen", "-t", "ed25519", "-q", "-N", "",
"-C", "lima", "-f", filepath.Join(configDir, filenames.UserPrivateKey))
logrus.Debugf("executing %v", keygenCmd.Args)
if out, err := keygenCmd.CombinedOutput(); err != nil {
return fmt.Errorf("failed to run %v: %q: %w", keygenCmd.Args, string(out), err)