host

package
v11.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const GroupExistExit = 9

man GROUPADD(8), exit codes section

View Source
const UserExistExit = 9

man USERADD(8), exit codes section

View Source
const UserLoggedInExit = 8

Variables

View Source
var ErrInvalidSudoers = errors.New("visudo: invalid sudoers file")

Functions

func AddUserToGroups

func AddUserToGroups(username string, groups []string) (exitCode int, err error)

AddUserToGroups adds a user to a list of specified groups on a host using `usermod`

func CheckSudoers

func CheckSudoers(contents []byte) error

CheckSudoers tests a suders file using `visudo`. The contents are written to the process via stdin pipe.

func GetAllUsers

func GetAllUsers() ([]string, int, error)

func GroupAdd

func GroupAdd(groupname string) (exitCode int, err error)

GroupAdd creates a group on a host using `groupadd`

func UserAdd

func UserAdd(username string, groups []string) (exitCode int, err error)

UserAdd creates a user on a host using `useradd`

func UserDel

func UserDel(username string) (exitCode int, err error)

UserDel creates a user on a host using `userdel`

Types

This section is empty.

Jump to

Keyboard shortcuts

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