Documentation ¶
Index ¶
- Constants
- Variables
- func AddUserToGroups(username string, groups []string) (exitCode int, err error)
- func CheckSudoers(contents []byte) error
- func GetAllUsers() ([]string, int, error)
- func GroupAdd(groupname string) (exitCode int, err error)
- func UserAdd(username string, groups []string) (exitCode int, err error)
- func UserDel(username string) (exitCode int, err error)
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 ¶
AddUserToGroups adds a user to a list of specified groups on a host using `usermod`
func CheckSudoers ¶
CheckSudoers tests a suders file using `visudo`. The contents are written to the process via stdin pipe.
func GetAllUsers ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.