Used to intitiate SSH and SFTP connections.

Example

B.io.jsch("sftp.myassn.com")
.knownHosts("sftp.myassn.com ecdsa-sha2-nistp256 some-very-long-key")
.username("sftpuser")
.password("test")
.session(session => {
session.sftpClient(clientSession => {
O += clientSession.ls(".");
})
});

Example

B.io.jsch("something")
.identity("privatekey")
.name("something")
.passphrase("password")
.publicKey("publickey")
.end()
.identity("other_privatekey")
.name("other_something")
.passphrase("other_password")
.publicKey("other_publickey")
.end()
.session(sess => {})

Hierarchy

  • JSch

Constructors

Methods

  • Sets the remote host's port for this jsch session

    Parameters

    • port: number

    Returns JSch

  • Set the known hosts before establishing a connection. Run this command to find the value for a host, ssh-keyscan -H -t rsa MY_SSH_HOST.COM

    Parameters

    • hosts: string

    Returns JSch

  • Sets the password for this jsch session

    Parameters

    • password: string

    Returns JSch

  • Helper to retrieve the known hosts entry This is the same as the following code segment:

    return session(
    session => session.config("StrictHostKeyChecking", "no"),
    session => session.knownHostsEntry();
    });

    Returns string

  • Creates a jsch session with given username/password. Same as calling session(session => {}, afterConnect)

    Type Parameters

    • R

    Parameters

    • afterConnect: ((session) => R)

      A callback function that is called after the connection is established so that you can perform any operations.

    Returns R

  • Creates a jsch session with given username/password.

    Type Parameters

    • R

    Parameters

    • beforeConnect: ((session) => void)

      A callback function that is called before the connection is established so that you can set any additional configurations.

        • (session): void
        • Parameters

          Returns void

    • afterConnect: ((session) => R)

      A callback function that is called after the connection is established so that you can perform any operations.

    Returns R

  • Sets the Username for this jsch session

    Parameters

    • username: string

    Returns JSch

Generated using TypeDoc