Documentation
¶
Overview ¶
TODO: High-level file comment.
TODO: High-level file comment.
TODO: High-level file comment.
Index ¶
- Constants
- Variables
- func SCPSendDir(path string, fi os.FileInfo, src *bufio.Reader, dst io.Writer) error
- func SCPSendFile(path string, src *bufio.Reader, dst io.Writer) error
- func SCPSendFile2(path string, fi os.FileInfo, src *bufio.Reader, dst io.Writer) error
- type EnvRequest
- type ExecRequest
- type PTYRequest
- type SCPCommand
- type Server
- func (s *Server) AddAuthorizedKeys(keyData []byte) *Server
- func (s *Server) AddHostkey(keyData []byte) error
- func (s *Server) AddHostkeyFrom(keypath string) error
- func (s *Server) AddUser(user, password string) *Server
- func (s *Server) Address() string
- func (s *Server) GetDoneChan() chan bool
- func (s *Server) HostAndPort() (string, string)
- func (s *Server) ListenAndServe(port int16) (error, func())
- func (s *Server) ListenAndServe2(addr string) (error, func())
- func (s *Server) ListenAndServeForever(port int16) error
- func (s *Server) ListenAndServeForever2(addr string) error
- func (s *Server) RandomHostkey() error
- func (s *Server) Stop()
- func (s *Server) VerifyPassword(conn ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error)
- func (s *Server) VerifyPublicKey(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error)
- func (s *Server) VerifyUserPublicKey(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error)
- func (s *Server) Wait()
- type ServerConn
- func (conn *ServerConn) Cancel()
- func (conn *ServerConn) ExecuteForChannel(shellCmd []string, ch ssh.Channel)
- func (conn *ServerConn) Exit(ch ssh.Channel)
- func (conn *ServerConn) HandleConn()
- func (conn *ServerConn) HandleSessionChannel(wg *sync.WaitGroup, newChan ssh.NewChannel)
- func (conn *ServerConn) HandleTCPIPChannel(wg *sync.WaitGroup, newChan ssh.NewChannel)
- func (conn *ServerConn) SCPHandler(shellCmd []string, ch ssh.Channel) error
- func (conn *ServerConn) SCPSink(path string, dirMode bool, ch ssh.Channel) error
- func (conn *ServerConn) SCPSource(path string, dirMode bool, recursive bool, ch ssh.Channel) error
- func (conn *ServerConn) ServiceGlobalRequests()
Constants ¶
View Source
const ( SCPCopy = iota SCPDir SCPEndDir SCPTime )
View Source
const ( SCPOK = iota SCPError SCPFatal )
Variables ¶
View Source
var ( SCP_END_COMMANDS = "\x00" ErrInvalidAck = errors.New("Invalid ack code.") ErrInvalidPieces = errors.New("Invalid number of command pieces.") ErrNotRegularFile = errors.New("Not a regular file.") ErrNotDirectory = errors.New("Not a directory.") ErrNullByte = errors.New("Expected null byte for EOF.") )
Functions ¶
func SCPSendDir ¶
Send a directory
func SCPSendFile ¶
Send a file
Types ¶
type EnvRequest ¶
type ExecRequest ¶
type ExecRequest struct {
Cmd string
}
type PTYRequest ¶
type Server ¶
type Server struct { ServerConfig ssh.ServerConfig Socket net.Listener AuthorizedKeys map[string]bool PasswordMap map[string]string // contains filtered or unexported fields }
Manage the SSH Server
func NewServer ¶
func NewServer() *Server
NewServer create new server instance with global authorized keys (load before start with AddAuthorizedKeys)
func NewServerPerUser ¶
NewServer create new server instance with per-user authorized keys (stored in keyDir)
func (*Server) AddAuthorizedKeys ¶
func (*Server) AddHostkey ¶
func (*Server) AddHostkeyFrom ¶
func (*Server) GetDoneChan ¶
func (*Server) HostAndPort ¶
func (*Server) ListenAndServe ¶
func (*Server) ListenAndServe2 ¶
func (*Server) ListenAndServeForever ¶
func (*Server) ListenAndServeForever2 ¶
func (*Server) RandomHostkey ¶
func (*Server) VerifyPassword ¶
func (s *Server) VerifyPassword(conn ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error)
func (*Server) VerifyPublicKey ¶
func (s *Server) VerifyPublicKey(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error)
func (*Server) VerifyUserPublicKey ¶
func (s *Server) VerifyUserPublicKey(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error)
type ServerConn ¶
type ServerConn struct { *Server *ssh.ServerConn // contains filtered or unexported fields }
Handling for a single incoming connection
func NewServerConn ¶
func NewServerConn(conn net.Conn, s *Server) (*ServerConn, error)
func (*ServerConn) Cancel ¶
func (conn *ServerConn) Cancel()
func (*ServerConn) ExecuteForChannel ¶
func (conn *ServerConn) ExecuteForChannel(shellCmd []string, ch ssh.Channel)
Execute a process for the channel.
func (*ServerConn) Exit ¶
func (conn *ServerConn) Exit(ch ssh.Channel)
func (*ServerConn) HandleConn ¶
func (conn *ServerConn) HandleConn()
Handle a single established connection
func (*ServerConn) HandleSessionChannel ¶
func (conn *ServerConn) HandleSessionChannel(wg *sync.WaitGroup, newChan ssh.NewChannel)
func (*ServerConn) HandleTCPIPChannel ¶
func (conn *ServerConn) HandleTCPIPChannel(wg *sync.WaitGroup, newChan ssh.NewChannel)
func (*ServerConn) SCPHandler ¶
func (conn *ServerConn) SCPHandler(shellCmd []string, ch ssh.Channel) error
Manage SCP operations in a built-in fashion
func (*ServerConn) ServiceGlobalRequests ¶
func (conn *ServerConn) ServiceGlobalRequests()
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
scpdebug
Tool for debug logs of SCP, since it's an undocumented protocol.
|
Tool for debug logs of SCP, since it's an undocumented protocol. |
sshdog
TODO: High-level file comment.
|
TODO: High-level file comment. |
TODO: High-level file comment.
|
TODO: High-level file comment. |
Click to show internal directories.
Click to hide internal directories.