pam

package
v0.0.0-...-15a51b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package axiospam contains functionality to Authenticate a User with Pluggable Authentication Modules (PAM). Currently, all this package does is check the validity of a user's login passphrase. See http://www.linux-pam.org/Linux-PAM-html/ for more information.

You will need to have a pam module file called axiospam in your pam.d folder.

Example:
$cat /etc/pam.d/axiospam
#%PAM-1.0
# default for a centos system,
auth	   required	Pamsepermit.so
auth       substack     password-auth
auth       include      postlogin

# if we only want the local system use only this
#auth	required	Pamunix.so

This also links to libpam so you will need to have libpam-devel installed. on Ubuntu the pam-devel package is called libpam0g-dev

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PamResult

type PamResult int

PamResult is the result of a call to Authenticate

const (
	PamSuccess             PamResult = 0  /* Successful function return */
	PamOpenERR             PamResult = 1  /* dlopen() failure when dynamically */
	PamSymbolERR           PamResult = 2  /* Symbol not found */
	PamServiceERR          PamResult = 3  /* Error in service module */
	PamSystemERR           PamResult = 4  /* System error */
	PamBufERR              PamResult = 5  /* Memory buffer error */
	PamPermDenied          PamResult = 6  /* Permission denied */
	PamAuthERR             PamResult = 7  /* Authentication failure */
	PamCredInsufficient    PamResult = 8  /* Can not access authentication data */
	PamAuthInfoUnavail     PamResult = 9  /* Underlying authentication service */
	PamUserUnknown         PamResult = 10 /* User not known to the underlying */
	PamMaxTries            PamResult = 11 /* An authentication service has */
	PamNewAuthTokReqd      PamResult = 12 /* New authentication token required. */
	PamAcctExpired         PamResult = 13 /* User account has expired */
	PamSessiionERR         PamResult = 14 /* Can not make/remove an entry for */
	PamCredUnavail         PamResult = 15 /* Underlying authentication service */
	PamCredExpired         PamResult = 16 /* User credentials expired */
	PamCredERR             PamResult = 17 /* Failure setting user credentials */
	PamNoModuleData        PamResult = 18 /* No module specific data is present */
	PamConvERR             PamResult = 19 /* Conversation error */
	PamAuthTokERR          PamResult = 20 /* Authentication token manipulation error */
	PamAuthTokRecoveryERR  PamResult = 21 /* Authentication information */
	PamAuthTokLockBusy     PamResult = 22 /* Authentication token lock busy */
	PamAuthTokDisableAging PamResult = 23 /* Authentication token aging disabled */
	PamTryAgain            PamResult = 24 /* Preliminary check by password service */
	PamIgnore              PamResult = 25 /* Ignore underlying account module */
	PamAbort               PamResult = 26 /* Critical error (?module fail now request) */
	PamAuthTokExpired      PamResult = 27 /* user's authentication token has expired */
	PamModuleUnknown       PamResult = 28 /* module is not known */
	PamBadItem             PamResult = 29 /* Bad item passed to Pam*_item() */
	PamConvAgain           PamResult = 30 /* conversation function is event driven and data is not available yet */
	PamIncomplete          PamResult = 31 /* please call this function again to */
)

func AccountFlags

func AccountFlags(name string) (PamResult, error)

AccountFlags get the User Account Flags from Pam

func Authenticate

func Authenticate(name, password string) (PamResult, error)

Authenticate takes the username and password and checks it with PAM

func ChangePassword

func ChangePassword(name, oldPassword, newPassword string) (PamResult, error)

ChangePassword will call the pam system to change the users password

func (PamResult) Error

func (s PamResult) Error() string

Error will let use use a PamResult as an Error, will use string to make it a String

func (PamResult) String

func (s PamResult) String() string

String will convert a PamResult to a String

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL