Documentation ¶
Index ¶
- func NewSubsystemClient(conn *ssh.Client, subsystem string, opts ...sftp.ClientOption) (*sftp.Client, error)
- func NewSubsystemCommandClient(conn *ssh.Client, cmd string, opts ...sftp.ClientOption) (*sftp.Client, error)
- func NewSudoClient(conn *ssh.Client, user, sudopwd string, opts ...sftp.ClientOption) (*sftp.Client, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSubsystemClient ¶
func NewSubsystemClient(conn *ssh.Client, subsystem string, opts ...sftp.ClientOption) (*sftp.Client, error)
NewSubsystemClient creates a new SFTP client on conn, using zero or more option functions.
Subsystem must be defined in targets sshd_config.
func NewSubsystemCommandClient ¶
func NewSubsystemCommandClient(conn *ssh.Client, cmd string, opts ...sftp.ClientOption) (*sftp.Client, error)
NewSubsystemCommandClient creates a new SFTP client on conn, using a custom subsystem command and zero or more option functions.
Command cmd can be used to specify a custom subsystem command, similar to the -s option for sftp cli.
Specify subsystem as a path when the remote sshd does not have an sftp Subsystem configured. Specify subsystem as "sudo -u [user] /path/to/sftp-server" to get SFTP with another user.
Sudo must have NOPASSWD for the sftp-server binary.
func NewSudoClient ¶
func NewSudoClient(conn *ssh.Client, user, sudopwd string, opts ...sftp.ClientOption) (*sftp.Client, error)
NewSudoClient creates a new SFTP client on conn, using user and sudopass for the conn user and zero or more option functions.
The user is the user to get an sftp client for. Sudopwd is the password for the user on conn.
Types ¶
This section is empty.