Documentation
¶
Index ¶
- Constants
- Variables
- func AddLoginUser(fs afero.Fs, username, groupname, homeDir, shell, baseDir string) (uint16, uint16, error)
- func AddRootUser(fs afero.Fs, shell, baseDir string) (uint16, uint16, error)
- func AddSystemUser(fs afero.Fs, username, groupname, homeDir, baseDir string) (uint16, uint16, error)
- func AddUser(fs afero.Fs, username, groupname, homeDir, shell, baseDir string, ...) (uint16, uint16, error)
- type GShadowEntry
- type GroupEntry
- type PasswdEntry
- type ShadowEntry
Constants ¶
View Source
const ( UID_GID_MIN = 1000 UID_GID_MAX uint16 = 1<<15 - 1 UID_GID_MIN_SYS = 100 UID_GID_MAX_SYS = 999 )
Variables ¶
Functions ¶
func AddLoginUser ¶
func AddLoginUser(fs afero.Fs, username, groupname, homeDir, shell, baseDir string) (uint16, uint16, error)
AddLoginUser adds a user that can log in with a valid shell and home directory.
func AddRootUser ¶
AddRootUser adds the root user.
Types ¶
type GShadowEntry ¶
type GShadowEntry struct {
Groupname string
Password string
Admins []string
Users []string
// contains filtered or unexported fields
}
func ParseGShadow ¶
func ParseGShadow(fs afero.Fs, shadowFile string) (map[string]*GShadowEntry, []*GShadowEntry, error)
func (GShadowEntry) String ¶
func (g GShadowEntry) String() string
type GroupEntry ¶
type GroupEntry struct {
Groupname string
Password string
GID uint16
Users []string
// contains filtered or unexported fields
}
func ParseGroup ¶
func ParseGroup(fs afero.Fs, groupFile string) (map[uint16]*GroupEntry, map[string]*GroupEntry, []*GroupEntry, error)
func (*GroupEntry) String ¶
func (g *GroupEntry) String() string
type PasswdEntry ¶
type PasswdEntry struct {
Username string
Password string
UID uint16
GID uint16
Comment string
HomeDir string
Shell string
}
func ParsePasswd ¶
func ParsePasswd(fs afero.Fs, passwdFile string) (map[uint16]*PasswdEntry, map[string]*PasswdEntry, []*PasswdEntry, error)
func (PasswdEntry) String ¶
func (p PasswdEntry) String() string
type ShadowEntry ¶
type ShadowEntry struct {
Username string
Password string
LastChange int
MinAge int
MaxAge int
WarningPeriod int
InactivityPeriod int
Expiration int
Unused string
}
func ParseShadow ¶
func ParseShadow(fs afero.Fs, shadowFile string) (map[string]*ShadowEntry, []*ShadowEntry, error)
func (ShadowEntry) String ¶
func (s ShadowEntry) String() string
Click to show internal directories.
Click to hide internal directories.