Skip to content

Java Jsch library like sftp login interface implement #596

@je-ck

Description

@je-ck

hi, is there a way to implement jsch sftp interface such as UserInfo, UIKeyboardInteractive to login sftp server?
I try to login with the following code:

	sshConfig := &ssh.ClientConfig{
		User: sftpUser,
		Auth: []ssh.AuthMethod{
			ssh.Password(sftpPassword),
			ssh.KeyboardInteractive(
				func(name, instruction string, questions []string, echos []bool) ([]string, error) {
					responses := make([]string, len(questions))
					for i, q := range questions {
						responses[i] = password
					}
					return responses, nil
				}),
		},
		HostKeyCallback: ssh.InsecureIgnoreHostKey(),
	}
	conn, err := ssh.Dial("tcp", addr, sshConfig)

but fail without setting up handshake and none prompt message, while jsch example login successfully with code like http://www.jcraft.com/jsch/examples/Sftp.java.html.
can you give me some example such as jsch or any advise to implement it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions