Initial import

This commit is contained in:
2025-10-10 10:05:13 +02:00
parent 3effc1597b
commit b96b6e7f8f
164 changed files with 5473 additions and 0 deletions

28
ssh/client.go Normal file
View File

@@ -0,0 +1,28 @@
package ssh
import (
"net"
"golang.org/x/crypto/ssh"
)
type Client struct {
netConn net.Conn
client *ssh.Client
}
type ClientConfig struct {
ssh.ClientConfig
}
func NewClient(conn net.Conn, config *ClientConfig) (*Client, error) {
sshConn, channels, requests, err := ssh.NewClientConn(conn, conn.RemoteAddr().String(), &config.ClientConfig)
if err != nil {
return nil, err
}
return &Client{
netConn: conn,
client: ssh.NewClient(sshConn, channels, requests),
}, nil
}