Documentation
¶
Index ¶
- func DockerCleanup() error
- func DockerKill(containerID string) error
- func DockerListContainers(all bool) ([]string, error)
- func DockerRemove(containerID string) error
- func SetWinsize(fd uintptr, w, h uint32)
- type Client
- type ClientConfig
- type Environment
- type Server
- func (s *Server) AddHostKey(keystring string) error
- func (s *Server) CheckConfig(config *ClientConfig) error
- func (s *Server) Handle(netConn net.Conn) error
- func (s *Server) Init() error
- func (s *Server) KeyboardInteractiveCallback(conn ssh.ConnMetadata, challenge ssh.KeyboardInteractiveChallenge) (*ssh.Permissions, error)
- func (s *Server) PasswordCallback(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)
- func (s *Server) PublicKeyCallback(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error)
- type Winsize
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
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 ClientConfig struct {
ImageName string `json:"image-name",omitempty`
RemoteUser string `json:"remote-user",omitempty`
Allowed bool `json:"allowed",omitempty`
Env Environment `json:"env",omitempty`
IsLocal bool `json:"is_local",omitempty`
Command []string `json:"command",omitempty`
User string `json:"user",omitempty`
Keys []string `json:"keys",omitempty`
EntryPoint string `json:"entrypoint",omitempty`
}
type Environment ¶
func (*Environment) ApplyDefaults ¶ added in v1.2.0
func (e *Environment) ApplyDefaults()
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
PublicKeyAuthScript string
LocalUser string
Banner 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) CheckConfig ¶ added in v1.2.0
func (s *Server) CheckConfig(config *ClientConfig) error
CheckConfig checks if the ClientConfig has access
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) KeyboardInteractiveCallback ¶ added in v1.2.0
func (s *Server) KeyboardInteractiveCallback(conn ssh.ConnMetadata, challenge ssh.KeyboardInteractiveChallenge) (*ssh.Permissions, error)
KeyboardInteractiveCallback is called after PublicKeyCallback
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
func (*Server) PublicKeyCallback ¶ added in v1.2.0
func (s *Server) PublicKeyCallback(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error)
PublicKeyCallback is called when the user tries to authenticate using an SSH public key
