Documentation
¶
Index ¶
- Constants
- Variables
- func CommandReset(cmd *cobra.Command)
- func DefaultCmd(s *Session, r *routertwo.Router) *cobra.Command
- func DefaultConfig() (*ssh.ServerConfig, error)
- type ChannelConn
- type Console
- type Server
- type Session
- func (s *Session) Close() error
- func (s *Session) DialContext(ctx context.Context, network, address string) (net.Conn, error)
- func (s *Session) DisableTimeout()
- func (s *Session) FQDN() string
- func (s *Session) Forwards() map[uint32]struct{}
- func (s *Session) Handle()
- func (s *Session) KeepAlive()
- func (s *Session) PokeTimeout()
- func (s *Session) Replaced()
- func (s *Session) Timeout()
Constants ¶
const IdleTimeout = time.Minute
IdleTimeout sets how long a session can be idle before getting disconnected
const KeepAliveInterval = time.Minute * 10
const KeepAliveTimeout = time.Second * 15
Variables ¶
var RawPrivateKey string
RawPrivateKey could be set with ldflags on build time
Functions ¶
func DefaultCmd ¶
DefaultCmd is the default top level command, embedding all others
func DefaultConfig ¶
func DefaultConfig() (*ssh.ServerConfig, error)
DefaultConfig generates a default ssh.ServerConfig
Types ¶
type ChannelConn ¶
ChannelConn embedds a ssh.Channel and implements dummy methods to fulfill the net.Conn interface
func (*ChannelConn) LocalAddr ¶
func (c *ChannelConn) LocalAddr() net.Addr
LocalAddr is required by net.Conn
func (*ChannelConn) RemoteAddr ¶
func (c *ChannelConn) RemoteAddr() net.Addr
RemoteAddr is required by net.Conn
func (*ChannelConn) SetDeadline ¶
func (c *ChannelConn) SetDeadline(_ time.Time) error
SetDeadline is required by net.Conn
func (*ChannelConn) SetReadDeadline ¶
func (c *ChannelConn) SetReadDeadline(_ time.Time) error
SetReadDeadline is required by net.Conn
func (*ChannelConn) SetWriteDeadline ¶
func (c *ChannelConn) SetWriteDeadline(_ time.Time) error
SetWriteDeadline is required by net.Conn
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console represents a terminal and handles commands
type Server ¶
type Server struct { // Config is the ssh serverconfig Config *ssh.ServerConfig Router *routertwo.Router }
Server represents a listening ssh server
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a ongoing SSH connection
func (*Session) DialContext ¶
DialContext tries to dial connections though the ssh session FIXME: figure out what to do with the Context
func (*Session) DisableTimeout ¶
func (s *Session) DisableTimeout()
DisableTimeout disables the idle timeout, used when a connection provides some endpoints i.e. requests ports to be forwarded...
func (*Session) PokeTimeout ¶
func (s *Session) PokeTimeout()
PokeTimeout postprones the idle timer - unless disabled or already fired