Documentation
¶
Overview ¶
Package ssh provides core SSH server functionality for ssh-ify.
Index ¶
- Constants
- func CopyWithSSHBuffer(dst io.Writer, src io.Reader) (int64, error)
- func ForwardData(ch ssh.Channel, targetConn net.Conn, addr string)
- func GetUserDB() *usermgmt.UserDB
- func HandleSSHChannels(chans <-chan ssh.NewChannel)
- func HandleSSHConnection(conn net.Conn, config *ssh.ServerConfig, onAuthSuccess func())
- func InitializeAuth(dbPath string) error
- func NewConfig() (*ssh.ServerConfig, error)
- func NewRSAPrivateKey(bitSize int) (*rsa.PrivateKey, error)
- func PasswordAuth(c ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)
- func RSAPrivateKeyPEM(privateKey *rsa.PrivateKey) []byte
- type ServerConfig
Constants ¶
const ( // SSHBufferPoolSize is the size of each buffer in the SSH pool (32KB) // Optimized for SSH channel data transfer SSHBufferPoolSize = 32 * 1024 )
Constants
Variables ¶
This section is empty.
Functions ¶
func CopyWithSSHBuffer ¶
CopyWithSSHBuffer performs buffered copying using a pooled buffer.
func ForwardData ¶
Channel handling functions ForwardData relays data bidirectionally between an SSH channel and a target connection.
func HandleSSHChannels ¶
func HandleSSHChannels(chans <-chan ssh.NewChannel)
HandleSSHChannels processes incoming SSH channels for port forwarding.
func HandleSSHConnection ¶
func HandleSSHConnection(conn net.Conn, config *ssh.ServerConfig, onAuthSuccess func())
Server functions HandleSSHConnection handles an incoming SSH connection.
func InitializeAuth ¶
Authentication functions InitializeAuth sets up the global authentication system.
func NewConfig ¶
func NewConfig() (*ssh.ServerConfig, error)
Configuration functions NewConfig initializes and returns a new SSH server configuration.
func NewRSAPrivateKey ¶
func NewRSAPrivateKey(bitSize int) (*rsa.PrivateKey, error)
Key generation functions NewRSAPrivateKey generates a new RSA private key.
func PasswordAuth ¶
func PasswordAuth(c ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)
PasswordAuth implements ssh.PasswordCallback for authentication.
func RSAPrivateKeyPEM ¶
func RSAPrivateKeyPEM(privateKey *rsa.PrivateKey) []byte
RSAPrivateKeyPEM encodes an RSA private key to PEM format.
Types ¶
type ServerConfig ¶
type ServerConfig = ssh.ServerConfig
Type aliases ServerConfig is a type alias for ssh.ServerConfig.