Documentation ¶
Overview ¶
Package host defines authentication and sessions handles to SSH when it is running in host mode.
Host mode means that the SSH's server runs in the host machine, using the host "/etc/passwd", "/etc/shadow", redirecting the SSH's connection to the device sdin, stdout and stderr and other things needed to run the SSH's server in the host machine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator implements the Authenticator interface when the server is running in host mode.
func NewAuthenticator ¶
func NewAuthenticator(api client.Client, authData *models.DeviceAuthResponse, singleUserPassword string, deviceName *string) *Authenticator
NewAuthenticator creates a new instance of Authenticator for the host mode. It receives the api client to perform requests to the ShellHub's API, the authentication data received by the agent when started the communication between it and the agent, the singleUserPassword, what indicates is is running at this mode and the deviceName.
The deviceName is a pointer to a string because when the server is created, we don't know the device name yet, that is set later.
type Mode ¶ added in v0.14.0
type Mode struct { Authenticator Sessioner }
type Sessioner ¶
type Sessioner struct {
// contains filtered or unexported fields
}
Sessioner implements the Sessioner interface when the server is running in host mode.
func NewSessioner ¶
NewSessioner creates a new instance of Sessioner for the host mode. The device name is a pointer to a string because when the server is created, we don't know the device name yet, that is set later.
func (*Sessioner) Exec ¶
Exec handles the SSH's server exec session when server is running in host mode.
func (*Sessioner) Heredoc ¶
Heredoc handles the server's SSH heredoc session when server is running in host mode.
heredoc is special block of code that contains multi-line strings that will be redirected to a stdin of a shell. It request a shell, but doesn't allocate a pty.