Documentation ¶
Index ¶
- type SSH
- func (ss *SSH) ExecCommand(host string, cmd string) (resp []byte, err error)
- func (ss *SSH) GetAuthMethod() (auth []ssh.AuthMethod)
- func (ss *SSH) GetSSHClientConfig(user string) *ssh.ClientConfig
- func (ss *SSH) GetSSHSession() *ssh.Session
- func (ss *SSH) NewSSHClient(user string, host string) *ssh.Client
- func (ss *SSH) NewSSHSession() *ssh.Session
- type SSHClient
- type SSHClientConfig
- type SSHSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SSH ¶
type SSH struct { User string Password string PrivateKeyFileName string PrivateKeyPassword string AuthMethod string Timeout *time.Duration }
func (*SSH) ExecCommand ¶
func (*SSH) GetAuthMethod ¶
func (ss *SSH) GetAuthMethod() (auth []ssh.AuthMethod)
func (*SSH) GetSSHClientConfig ¶
func (ss *SSH) GetSSHClientConfig(user string) *ssh.ClientConfig
任何一个ssh连接都必须有一个该连接相关的配置,*ssh.ClientConfig,
1.config: config是客户端和服务端必须共同的一些配置, 2.user: 连接所使用的用户名 3.Auth: 4.HostKeyCallback: 5.BannerCallback: 6.HostKeyAlgorithms: 7.Timeout:
func (*SSH) GetSSHSession ¶
func (*SSH) NewSSHSession ¶
type SSHClientConfig ¶
type SSHClientConfig *ssh.ClientConfig
type SSHSession ¶
func (*SSHSession) Close ¶
func (ss *SSHSession) Close(cmd string)
func (*SSHSession) CombinedOutput ¶
func (ss *SSHSession) CombinedOutput(cmd string)
func (*SSHSession) Output ¶
func (ss *SSHSession) Output(cmd string)
func (*SSHSession) Run ¶
func (ss *SSHSession) Run(cmd string)
func (*SSHSession) SetEnv ¶
func (ss *SSHSession) SetEnv(cmd string)
func (*SSHSession) Start ¶
func (ss *SSHSession) Start(cmd string)
Click to show internal directories.
Click to hide internal directories.