pam

package
v3.1.0-alpha.1+incompa... Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

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

	// Username is the name of the target user.
	Username 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.

Jump to

Keyboard shortcuts

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