ssh

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 11 Imported by: 2

README

ssh

Documentation

Index

Constants

View Source
const PrivateKeyFileName = "id_ed25519"
View Source
const PublicKeyFileName = "id_ed25519.pub"

Variables

View Source
var (
	ErrCannotCreateSSHFolder  = errors.New("Cannot create .ssh folder in home folder")
	ErrCannotChangePermission = errors.New("Cannot change permission for the file or directory")
)

Functions

func AddToAuthorizedKeys

func AddToAuthorizedKeys(authorizedKeys, publicKey string, userId, groupId int) error

func CreateAuthorizedKeys

func CreateAuthorizedKeys(authorizedKeys string, userId, groupId int, perm int, exec func(file *os.File) error) error

Types

type Interface

type Interface interface {
	Write() error
}

type SSH

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

func New

func New(userId, userGroup int, homeFolder string) (SSH, error)

func (SSH) GetPrivateKeyPath

func (s SSH) GetPrivateKeyPath() string

func (SSH) GetPublicKey

func (s SSH) GetPublicKey() ([]byte, error)

func (SSH) GetPublicKeyPath

func (s SSH) GetPublicKeyPath() string

func (SSH) Write

func (s SSH) Write() error

Jump to

Keyboard shortcuts

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