Documentation ¶
Index ¶
- Constants
- func AddUser(username string, hashedPassword string, uid string, ...) error
- func HashPassword(password string) (string, error)
- func NameIsValid(name string) (err error)
- func PasswordExpiresDaysIsValid(passwordExpiresDays int64) error
- func UIDIsValid(uid int) error
- func UpdateUserPassword(installRoot, username, hashedPassword string) error
- func UserExists(username string, installChroot safechroot.ChrootInterface) (bool, error)
- func UserHomeDirectory(username string) string
Constants ¶
View Source
const ( RootUser = "root" RootHomeDir = "/root" UserHomeDirPrefix = "/home" ShadowFile = "/etc/shadow" )
Variables ¶
This section is empty.
Functions ¶
func AddUser ¶
func AddUser(username string, hashedPassword string, uid string, installChroot safechroot.ChrootInterface) error
func HashPassword ¶
func NameIsValid ¶
NameIsValid returns an error if the User name is empty
func PasswordExpiresDaysIsValid ¶
PasswordExpiresDaysISValid returns an error if the expire days is not within bounds set by the chage -M command
func UIDIsValid ¶
UIDIsValid returns an error if the UID is outside bounds UIDs 1-999 are system users and 1000-60000 are normal users Bounds can be checked using: $grep -E '^UID_MIN|^UID_MAX' /etc/login.defs
func UpdateUserPassword ¶
func UserExists ¶
func UserExists(username string, installChroot safechroot.ChrootInterface) (bool, error)
func UserHomeDirectory ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.