Documentation ¶
Index ¶
Constants ¶
View Source
const ( RP_ECHO = 1 << iota /* echo stuff or something 8 */ RP_ALLOW_STDIN /* Allow stdin and not askpass */ RP_ALLOW_EOF /* not used */ RP_USE_ASKPASS /* Use SSH_ASKPASS */ RP_ASK_PERMISSION /* Ask for permission, yes/no prompt */ RP_NEWLINE /* Print newline after answer. */ RPP_ECHO_OFF /* Turn off echo (default). */ RPP_ECHO_ON /* Leave echo on. */ RPP_REQUIRE_TTY /* Fail if there is no tty. */ RPP_FORCELOWER /* Force input to lower case. */ RPP_FORCEUPPER /* Force input to upper case. */ RPP_SEVENBIT /* Strip the high bit from input. */ RPP_STDIN /* Read from stdin, not /dev/tty */ )
Variables ¶
View Source
var ( ErrNoAskpass = errors.New("system does not have an askpass program") // Default ASKPASS programs SSH_ASKPASS_DEFAULTS = []string{ "/usr/lib/ssh/x11-ssh-askpass", "/usr/lib/ssh/gnome-ssh-askpass3", "/usr/lib/ssh/gnome-ssh-askpass", "/usr/libexec/openssh/gnome-ssh-askpass", "/usr/bin/ksshaskpass", } )
Functions ¶
func AskPermission ¶
AskPremission runs SSH_ASKPASS in with SSH_ASKPASS_PROMPT=confirm set as env it will expect exit code 0 or !0 and return 'yes' and 'no' respectively.
func ReadPassphrase ¶
func ReadPassphrase(prompt string, flags ReadPassFlags) ([]byte, error)
func SshAskPass ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.