Documentation
¶
Overview ¶
Package usermgr provides Linux system user account management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
List(ctx context.Context) ([]*User, error)
Get(ctx context.Context, username string) (*User, error)
Add(ctx context.Context, u *User, password string) error
Edit(ctx context.Context, username string, u *User, password string) error
Delete(ctx context.Context, username string, removeHome bool) error
Lock(ctx context.Context, username string) error
Unlock(ctx context.Context, username string) error
AvailableShells(ctx context.Context) ([]string, error)
}
Client defines the interface for system user management.
type User ¶
type User struct {
Username string `json:"username"`
UID int `json:"uid"`
GID int `json:"gid"`
Comment string `json:"comment"` // GECOS field (full name)
HomeDir string `json:"homeDir"`
Shell string `json:"shell"`
Locked bool `json:"locked"` // shadow entry starts with "!"
System bool `json:"system"` // UID < 1000
Groups []string `json:"groups"` // supplementary groups
}
User represents a Linux system user account.
Click to show internal directories.
Click to hide internal directories.