system

package
v0.0.0-...-4892902 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const AuthorizedKeysTemplate = `cert-authority,principals="PRINCIPAL" USER_KEY`
View Source
const DefaultUserKey = `` /* 380-byte string literal not displayed */

TODO update this and it can be several keys

Variables

This section is empty.

Functions

func CreateAuthorizedKeysFile

func CreateAuthorizedKeysFile(filePath string, content string) error

func GenerateAuthorizedKeysFile

func GenerateAuthorizedKeysFile(principal string, userKey string) string

Types

type Interface

type Interface interface {
	// Create home directory for new user
	CreateHomeDir(dir string, uid, gid int) error
	CreateAuthorizedKeysFile(homeDir string, principal string) error
	FixChown(homeDir string, uid, gid int) error
	// Recursively delete home directory if exists.
	DeleteHomeDir(dir string) error
	// Kill all user processes.
	PurgeUserLegacy(username string) error
}

type SystemOperator

type SystemOperator struct {
	// contains filtered or unexported fields
}

func NewSystemOperator

func NewSystemOperator() *SystemOperator

func (*SystemOperator) CreateAuthorizedKeysFile

func (s *SystemOperator) CreateAuthorizedKeysFile(homeDir string, principal string) error

func (*SystemOperator) CreateHomeDir

func (s *SystemOperator) CreateHomeDir(dir string, uid, gid int) error

func (*SystemOperator) DeleteHomeDir

func (s *SystemOperator) DeleteHomeDir(dir string) error

func (*SystemOperator) FixChown

func (s *SystemOperator) FixChown(homeDir string, uid, gid int) error

func (*SystemOperator) PurgeUserLegacy

func (s *SystemOperator) PurgeUserLegacy(username string) error

Jump to

Keyboard shortcuts

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