Documentation ¶
Overview ¶
Package pam implements the PAM for user authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
func Authenticate(pamh *C.pam_handle_t) C.int
Authenticate is the entry of Go language part. It is invoked by pam_sm_authenticate in C language part.
func SetNonSSHAgentAuthN ¶
func SetNonSSHAgentAuthN(fn AuthNFn)
SetNonSSHAgentAuthN sets the fallback authentication method when the ssh-agent connection fails.
Types ¶
type AuthNFn ¶
AuthNFn is the interface to do authentication for the given principal. Currently, we don't set up multiple go PAM library into the same, because dynamically linking multiple cgo runtime into same process would cause the program crash. (A similar issue at go 1.7: https://github.com/golang/go/issues/18976). So we declare an interface here to inject secondary or fallback authN method (e.g. CryptoAuth) into PAM_SSHCA. TODO: Investigate the cgo runtime issue again and check if there's a workaround to integrate multiple cgo libraries into the same pam config.
func NonSSHAgentAuthN ¶
func NonSSHAgentAuthN() AuthNFn
NonSSHAgentAuthN returns the method of the fallback authentication when the ssh-agent connection fails.