mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-27 20:36:29 -04:00
18 lines
369 B
Go
18 lines
369 B
Go
package sync
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"golang.org/x/term"
|
|
)
|
|
|
|
// inputKeyFilePassphrase prompts the user for a passphrase for an SSH key file.
|
|
// TODO support non-CLI implementations
|
|
func inputKeyFilePassphrase() []byte {
|
|
fmt.Print("\nEnter passphrase for your SSH keyfile: ")
|
|
passphrase, _ := term.ReadPassword(int(os.Stdin.Fd()))
|
|
fmt.Println()
|
|
return passphrase
|
|
}
|