Documentation ¶
Index ¶
- Variables
- func AuthorizedKeys(ctx *cli.Context) error
- func CatCommand(ctx *cli.Context) error
- func KeygenCommand(ctx *cli.Context) error
- func ListCommand(ctx *cli.Context) error
- func Main(args []string, output io.Writer) error
- func ShellCommand(ctx *cli.Context) error
- func Sync(ctx *cli.Context) error
- func SyncOnce(config *Config, dryRun bool, stdout io.Writer) error
- func WebCommand(ctx *cli.Context) error
- func WithError(f func(context *cli.Context) error) func(*cli.Context)
- type Config
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 ¶
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 KeygenCommand ¶
func ListCommand ¶
func ShellCommand ¶
func WebCommand ¶
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 ¶
LoadConfig returns a new config object by reading the file at path.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.