2022-08-21 19:36:08 +08:00
|
|
|
package option
|
|
|
|
|
|
2024-11-18 18:55:34 +08:00
|
|
|
import "github.com/sagernet/sing/common/json/badoption"
|
|
|
|
|
|
2026-06-07 07:59:43 +03:00
|
|
|
type SSHInboundOptions struct {
|
|
|
|
|
ListenOptions
|
|
|
|
|
Users []SSHUser `json:"users,omitempty"`
|
|
|
|
|
HostKey badoption.Listable[string] `json:"host_key,omitempty"`
|
|
|
|
|
HostKeyPath badoption.Listable[string] `json:"host_key_path,omitempty"`
|
|
|
|
|
ServerVersion string `json:"server_version,omitempty"`
|
|
|
|
|
MaxAuthTries int `json:"max_auth_tries,omitempty"`
|
|
|
|
|
Fallback *SSHFallbackServerOptions `json:"fallback,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SSHFallbackServerOptions struct {
|
|
|
|
|
DialerOptions
|
|
|
|
|
ServerOptions
|
|
|
|
|
CA *SSHCAOptions `json:"ca,omitempty"`
|
|
|
|
|
IssueCA *SSHCAOptions `json:"issue_ca,omitempty"`
|
|
|
|
|
HostKey badoption.Listable[string] `json:"host_key,omitempty"`
|
|
|
|
|
HostKeyPath badoption.Listable[string] `json:"host_key_path,omitempty"`
|
|
|
|
|
HostKeyAlgorithms badoption.Listable[string] `json:"host_key_algorithms,omitempty"`
|
|
|
|
|
ClientVersion string `json:"client_version,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SSHCAOptions struct {
|
|
|
|
|
PrivateKey badoption.Listable[string] `json:"private_key,omitempty"`
|
|
|
|
|
PrivateKeyPath string `json:"private_key_path,omitempty"`
|
|
|
|
|
PrivateKeyPassphrase string `json:"private_key_passphrase,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SSHUser struct {
|
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
|
Password string `json:"password,omitempty"`
|
|
|
|
|
AuthorizedKeys badoption.Listable[string] `json:"authorized_keys,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-21 19:36:08 +08:00
|
|
|
type SSHOutboundOptions struct {
|
2022-09-03 12:55:10 +08:00
|
|
|
DialerOptions
|
2022-08-21 19:36:08 +08:00
|
|
|
ServerOptions
|
2024-11-18 18:55:34 +08:00
|
|
|
User string `json:"user,omitempty"`
|
|
|
|
|
Password string `json:"password,omitempty"`
|
|
|
|
|
PrivateKey badoption.Listable[string] `json:"private_key,omitempty"`
|
|
|
|
|
PrivateKeyPath string `json:"private_key_path,omitempty"`
|
|
|
|
|
PrivateKeyPassphrase string `json:"private_key_passphrase,omitempty"`
|
|
|
|
|
HostKey badoption.Listable[string] `json:"host_key,omitempty"`
|
|
|
|
|
HostKeyAlgorithms badoption.Listable[string] `json:"host_key_algorithms,omitempty"`
|
|
|
|
|
ClientVersion string `json:"client_version,omitempty"`
|
2022-08-21 19:36:08 +08:00
|
|
|
}
|