Documentation ¶
Index ¶
- func DiscardRequests(logger Logger, in <-chan *ssh.Request)
- func FormatPublicKey(pk ssh.PublicKey) string
- func GetHostkey(key string) (ssh.Signer, error)
- func IsClosedConnError(err error) bool
- func ParseHostkey(keyData []byte) (ssh.Signer, error)
- func RandomHostkey() (ssh.Signer, error)
- func RegistryHandleChannel(name string, fun HandleChannelFunc)
- func RegistryHandleRequest(name string, fun HandleRequestFunc)
- func Tunnel(ctx context.Context, c1, c2 io.ReadWriteCloser, buf1, buf2 []byte) error
- type Authorized
- type BytesPool
- type ChannelOpenDirectMsg
- type ExecMsg
- type ExitStatusMsg
- type ForwardMsg
- type ForwardResponseMsg
- type ForwardedStreamLocalPayload
- type ForwardedTCPPayload
- type HandleChannelFunc
- type HandleRequestFunc
- type Logger
- type Permissions
- type PtyRequestMsg
- type PtyWindowChangeMsg
- type Server
- type ServerConn
- type SetenvRequest
- type StreamLocalChannelForwardMsg
- type StreamLocalChannelOpenDirectMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscardRequests ¶ added in v0.1.1
DiscardRequests consumes and rejects all requests from the passed-in channel.
func FormatPublicKey ¶ added in v0.2.0
func IsClosedConnError ¶ added in v0.1.1
IsClosedConnError reports whether err is an error from use of a closed network connection.
func RandomHostkey ¶ added in v0.0.2
func RegistryHandleChannel ¶ added in v0.1.1
func RegistryHandleChannel(name string, fun HandleChannelFunc)
func RegistryHandleRequest ¶ added in v0.1.1
func RegistryHandleRequest(name string, fun HandleRequestFunc)
Types ¶
type Authorized ¶ added in v0.2.0
func GetAuthorizedFile ¶
func GetAuthorizedFile(authorized string) (*Authorized, error)
func ParseAuthorized ¶
func ParseAuthorized(r io.Reader) (*Authorized, error)
type BytesPool ¶
BytesPool is an interface for getting and returning temporary bytes for use by io.CopyBuffer.
type ChannelOpenDirectMsg ¶
ChannelOpenDirectMsg copy from golang.org/x/crypto/ssh.channelOpenDirectMsg
type ExecMsg ¶
type ExecMsg struct {
Command string
}
ExecMsg copy from golang.org/x/crypto/ssh.execMsg
type ExitStatusMsg ¶
type ExitStatusMsg struct {
Status uint32
}
ExitStatusMsg copy from golang.org/x/crypto/ssh.exitStatusMsg
type ForwardMsg ¶ added in v0.1.1
ForwardMsg copy from golang.org/x/crypto/ssh.channelForwardMsg
type ForwardResponseMsg ¶ added in v0.1.1
type ForwardResponseMsg struct {
Port uint32
}
type ForwardedStreamLocalPayload ¶ added in v0.1.5
ForwardedStreamLocalPayload copy from golang.org/x/crypto/ssh.forwardedStreamLocalPayload
type ForwardedTCPPayload ¶ added in v0.1.1
ForwardedTCPPayload copy from golang.org/x/crypto/ssh.forwardedTCPPayload
type HandleChannelFunc ¶ added in v0.1.1
type HandleChannelFunc func(ctx context.Context, newChan ssh.NewChannel, serverConn *ServerConn)
type HandleRequestFunc ¶ added in v0.1.1
type HandleRequestFunc func(ctx context.Context, req *ssh.Request, serverConn *ServerConn)
type Permissions ¶ added in v0.2.0
Permissions specifies the permissions that the user has
type PtyRequestMsg ¶
type PtyRequestMsg struct { Term string Columns uint32 Rows uint32 Width uint32 Height uint32 Modelist string }
PtyRequestMsg copy from golang.org/x/crypto/ssh.ptyRequestMsg
type PtyWindowChangeMsg ¶
PtyWindowChangeMsg copy from golang.org/x/crypto/ssh.ptyWindowChangeMsg
type Server ¶
type Server struct { // Context is default context Context context.Context // ServerConfig SSH Server config ServerConfig ssh.ServerConfig // Logger error log Logger Logger // ProxyDial specifies the optional proxyDial function for // establishing the transport connection. ProxyDial func(context.Context, string, string) (net.Conn, error) // ProxyListen specifies the optional proxyListen function for // establishing the transport connection. ProxyListen func(context.Context, string, string) (net.Listener, error) // UserPermissions are based on the user getting all their permissions // If nil, then allow all UserPermissions func(user string) Permissions // BytesPool getting and returning temporary bytes for use by io.CopyBuffer BytesPool BytesPool // Default environment Environ []string // Default workdir Dir string }
Server is accepting connections and handling the details of the SSH protocol
func (*Server) ListenAndServe ¶
ListenAndServe is used to create a listener and serve on it
type ServerConn ¶
type ServerConn struct { *ssh.ServerConn // BytesPool getting and returning temporary bytes for use by io.CopyBuffer BytesPool BytesPool // Logger error log Logger Logger // Newly Request Requests <-chan *ssh.Request // Newly channel Channels <-chan ssh.NewChannel // ProxyDial specifies the optional proxyDial function for // establishing the transport connection. ProxyDial func(context.Context, string, string) (net.Conn, error) // ProxyListen specifies the optional proxyListen function for // establishing the transport connection. ProxyListen func(context.Context, string, string) (net.Listener, error) // Default environment Environ []string // Default workdir Dir string // Permissions specify the permissions that the user has // If nil, then allow all Permissions Permissions }
ServerConn Handling for a single incoming connection
func NewServerConn ¶
func NewServerConn(conn net.Conn, config *ssh.ServerConfig) (*ServerConn, error)
func (*ServerConn) Handle ¶
func (s *ServerConn) Handle(ctx context.Context)
Handle a single established connection
type SetenvRequest ¶
SetenvRequest copy from golang.org/x/crypto/ssh.setenvRequest
type StreamLocalChannelForwardMsg ¶ added in v0.1.5
type StreamLocalChannelForwardMsg struct {
SocketPath string
}
StreamLocalChannelForwardMsg copy from golang.org/x/crypto/ssh.streamLocalChannelForwardMsg
type StreamLocalChannelOpenDirectMsg ¶ added in v0.1.5
StreamLocalChannelOpenDirectMsg copy from golang.org/x/crypto/ssh.streamLocalChannelOpenDirectMsg