cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2016 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigPath string = "/etc/usermgr.conf"

DefaultConfigPath is the default path to the configuration file.

View Source
var SyncInterval = time.Minute * 9

Functions

func AuthorizedKeys

func AuthorizedKeys(ctx *cli.Context) error

AuthorizedKeys implements the "authorized-keys" subcommand which prints the authorized keys for the specified user to stdout.

From the sshd_config(8) manpage:

AuthorizedKeysCommand
        Specifies a program to be used to look up the user's public keys.  The program
        will be invoked with a single argument of the username being authenticated, and
        should produce on standard output zero or more lines of authorized_keys output
        (see AUTHORIZED_KEYS in sshd(8)).  If a key supplied by AuthorizedKeysCommand does
        not successfully authenticate and authorize the user then public key authentica-
        tion continues using the usual AuthorizedKeysFile files.  By default, no Autho-
        rizedKeysCommand is run.

AuthorizedKeysCommandUser
        Specifies the user under whose account the AuthorizedKeysCommand is run.  It is
        recommended to use a dedicated user that has no other role on the host than run-
        ning authorized keys commands.

Example configuration:

AuthorizedKeysCommand /usr/bin/usermgr.sshkeys
AuthorizedKeysCommandUser nobody

func CatCommand

func CatCommand(ctx *cli.Context) error

func KeygenCommand

func KeygenCommand(ctx *cli.Context) error

func ListCommand

func ListCommand(ctx *cli.Context) error

func Main

func Main(args []string, output io.Writer) error

func ShellCommand

func ShellCommand(ctx *cli.Context) error

func Sync

func Sync(ctx *cli.Context) error

func SyncOnce

func SyncOnce(config *Config, dryRun bool, stdout io.Writer) error

func WebCommand

func WebCommand(ctx *cli.Context) error

func WithError

func WithError(f func(context *cli.Context) error) func(*cli.Context)

Types

type Config

type Config struct {
	// The URL where the account database is stored. This URL can also
	// point to a storage service, i.e. "https://s3.amazonaws.com/example/users.pem"
	URL string

	// Specifies the host key used to decrypt and verify the database
	HostKey usermgr.HostKey

	// Specifies the path where a local copy of the account database is stored.
	// (Default: /var/lib/usermgr)
	CacheDir string

	// Specifies which groups a user must be part of in order to enable their
	// account.
	LoginGroups []string

	// Specifies which groups a user must be part of in order to enable them
	// to sudo to root.
	SudoGroups []string

	// If true then all remote users must specify an MFA token to login.
	LoginMFARequried bool
}

Config describes the host configuration

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig returns a new config object by reading the file at path.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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