Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DockerCleanup ¶ added in v1.1.0
func DockerCleanup() error
DockerCleanup cleans all containers created by ssh2docker
func DockerKill ¶ added in v1.1.0
DockerKill kills a container
func DockerListContainers ¶ added in v1.1.0
DockerListContainers lists containers created by ssh2docker
func DockerRemove ¶ added in v1.1.0
DockerRemove removes a container
func SetWinsize ¶
Types ¶
type Client ¶
type Client struct {
Idx int
ChannelIdx int
Conn *ssh.ServerConn
Chans <-chan ssh.NewChannel
Reqs <-chan *ssh.Request
Server *Server
Pty, Tty *os.File
Env Environment
Config *ClientConfig
ClientID string
}
Client is one client connection
func NewClient ¶
func NewClient(conn *ssh.ServerConn, chans <-chan ssh.NewChannel, reqs <-chan *ssh.Request, server *Server) *Client
NewClient initializes a new client
func (*Client) HandleChannel ¶
func (c *Client) HandleChannel(newChannel ssh.NewChannel) error
HandleChannel handles one SSH channel
func (*Client) HandleChannelRequests ¶
HandleChannelRequests handles channel requests
func (*Client) HandleChannels ¶
HandleChannels handles SSH channels
func (*Client) HandleRequests ¶
HandleRequests handles SSH requests
type ClientConfig ¶ added in v1.1.0
type Environment ¶
func (*Environment) List ¶
func (e *Environment) List() []string
type Server ¶
type Server struct {
SshConfig *ssh.ServerConfig
// Clients map[string]Client
ClientConfigs map[string]*ClientConfig
AllowedImages []string
DefaultShell string
DockerRunArgs []string
NoJoin bool
CleanOnStartup bool
PasswordAuthScript string
// contains filtered or unexported fields
}
Server is the ssh2docker main structure
func (*Server) AddHostKey ¶
AddHostKey parses/loads an ssh key and registers it to the server
func (*Server) Handle ¶
Handle is the SSH client entrypoint, it takes a net.Conn instance and handle all the ssh and ssh2docker stuff
func (*Server) ImageIsAllowed ¶
ImageIsAllowed returns true if the target image is in the allowed list
func (*Server) PasswordCallback ¶
func (s *Server) PasswordCallback(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)
PasswordCallback is called when the user tries to authenticate using a password
