Documentation ¶
Index ¶
Constants ¶
View Source
const ID = "/ssh/1.0.0"
Variables ¶
This section is empty.
Functions ¶
func AddHostKey ¶
func AddHostKey(config *ssh.ServerConfig, privateBytes []byte) (ssh.ServerConfig, error)
AddHostKey add ssh private key to Host(.ssh/id_rsa)
func DefaultServerConfig ¶
func DefaultServerConfig() (config ssh.ServerConfig, err error)
DefaultServerConfig use privateDirectory $HOME/.ssh/ checkPasswd from /etc/shadow
Types ¶
type SSHClient ¶
type SSHClient struct { ClientConfig ssh.ClientConfig Stdout io.Writer Stderr io.Writer Stdin io.Reader // contains filtered or unexported fields }
func NewSSHClientWithConfig ¶
func NewSSHClientWithConfig(h host.Host, config ssh.ClientConfig) *SSHClient
NewSSHClientWithConfig Create a new ssh client with config
type SSHService ¶
type SSHService struct {
ServerConfig ssh.ServerConfig
}
func NewSSHService ¶
func NewSSHService(h host.Host) (*SSHService, error)
NewSSHService Create a Default ssh service
func NewSSHServiceWithConfig ¶
func NewSSHServiceWithConfig(h host.Host, config ssh.ServerConfig) *SSHService
NewSSHServiceWithConfig Create a ssh service with server config
Click to show internal directories.
Click to hide internal directories.