Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to obtain SSH passphrases (macOS High Sierra) #28

Open
nbari opened this issue Mar 12, 2018 · 0 comments
Open

How to obtain SSH passphrases (macOS High Sierra) #28

nbari opened this issue Mar 12, 2018 · 0 comments

Comments

@nbari
Copy link

nbari commented Mar 12, 2018

In macOS High Sierra (10.13.3) how could the ssh passphrases be obtained, currently trying with this without success:

    usr, _ := user.Current()
    dir := usr.HomeDir
    keyPath, err := filepath.Abs(filepath.Join(dir, ".ssh/id_rsa"))
    if err != nil {
            log.Fatal(err)
    }
    keyPassword, err := GetGenericPassword("SSH", keyPath, "", "")
    if err != nil {
            log.Fatal(err)
    }
    fmt.Printf("keyPassword = %s\n", keyPassword)

or also with:

    keyPassword, err := keychain.GetGenericPassword("OpenSSH", keyPath, "SSH: "+keyPath, "com.apple.ssh.passphrases")
    if err != nil {
            log.Fatal(err)
    }
    fmt.Printf("keyPassword = %s\n", keyPassword)

Any idea?

This seems to be related: https://apple.stackexchange.com/a/268175/104123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant