Skip to content

SSHAuthAbortError(Connection closed before authentication) when using jumpServer #83

Open
@mostcute

Description

@mostcute
import 'dart:convert';

import 'package:dartssh2/dartssh2.dart';

void main() async {
  final jumpServer = SSHClient(
    await SSHSocket.connect('pubnetip  on HostA', 22222),
    username: 'root',
    onPasswordRequest: () => 'xxxxx',
  );
  print("jumpServer ");

  final client = SSHClient(
    await jumpServer.forwardLocal('internal ip on HostB', 22),
    username: 'root',
    onPasswordRequest: () => 'xxxxx',
  );
  print("client ");
  print(utf8.decode(await client.run('hostname')));
  print(utf8.decode(await client.run('ifconfig')));
  print("client close");
  client.close();
  jumpServer.close();
}

the code can work sometimes,but it will meet err mosttime

E/flutter (22717): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: SSHAuthAbortError(Connection closed before authentication)

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