Skip to content

Commit 3370b73

Browse files
authored
Merge pull request #2365 from afbjorklund/ssh-key-comment
Remove user@host from the lima ssh key
2 parents a8b2f4d + 0082462 commit 3370b73

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/sshutil/sshutil.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ func DefaultPubKeys(loadDotSSH bool) ([]PubKey, error) {
6363
return nil, fmt.Errorf("could not create %q directory: %w", configDir, err)
6464
}
6565
if err := lockutil.WithDirLock(configDir, func() error {
66-
keygenCmd := exec.Command("ssh-keygen", "-t", "ed25519", "-q", "-N", "", "-f",
67-
filepath.Join(configDir, filenames.UserPrivateKey))
66+
// no passphrase, no user@host comment
67+
keygenCmd := exec.Command("ssh-keygen", "-t", "ed25519", "-q", "-N", "",
68+
"-C", "lima", "-f", filepath.Join(configDir, filenames.UserPrivateKey))
6869
logrus.Debugf("executing %v", keygenCmd.Args)
6970
if out, err := keygenCmd.CombinedOutput(); err != nil {
7071
return fmt.Errorf("failed to run %v: %q: %w", keygenCmd.Args, string(out), err)

0 commit comments

Comments
 (0)