pam

package
v4.3.10+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 2 Imported by: 92

Documentation

Overview

Package pam implements a subset of Pluggable Authentication Modules (PAM). The supported subset of the PAM stack is "account" and "session" modules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHasPAM

func BuildHasPAM() bool

BuildHasPAM returns true if the binary was build with support for PAM compiled in.

func SystemHasPAM

func SystemHasPAM() bool

SystemHasPAM returns true if the PAM library exists on the system.

Types

type Config

type Config struct {
	// Enabled controls if PAM checks will occur or not.
	Enabled bool

	// ServiceName is the name of the policy to apply typically in /etc/pam.d/
	ServiceName string

	// Login is the *nix login that that is being used.
	Login string `json:"login"`

	// Env is a list of extra environment variables to pass to the PAM modules.
	Env map[string]string

	// Stdin is the input stream which the conversation function will use to
	// obtain data from the user.
	Stdin io.Reader

	// Stdout is the output stream which the conversation function will use to
	// show data to the user.
	Stdout io.Writer

	// Stderr is the output stream which the conversation function will use to
	// report errors to the user.
	Stderr io.Writer
}

Config holds the configuration used by Teleport when creating a PAM context and executing PAM transactions.

func (*Config) CheckDefaults

func (c *Config) CheckDefaults() error

CheckDefaults makes sure the Config structure has minimum required values.

type PAM

type PAM struct {
}

PAM is used to create a PAM context and initiate PAM transactions to checks the users account and open/close a session.

func Open

func Open(config *Config) (*PAM, error)

Open creates a PAM context and initiates a PAM transaction to check the account and then opens a session.

func (*PAM) Close

func (p *PAM) Close() error

Close will close the session, the PAM context, and release any allocated memory.

func (*PAM) Environment

func (p *PAM) Environment() []string

Environment returns the PAM environment variables associated with a PAM handle.

Jump to

Keyboard shortcuts

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