Code Monkey home page Code Monkey logo

dartssh2's People

Contributors

cconstab avatar greenappers avatar kevin-lot avatar pedia avatar pidami avatar xtyxtyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dartssh2's Issues

SFTP

Great initiative ! The ssh & ssh2 plugins doesn't work well for me.
Looking forward for the SFTP feature to be released :)
Thanks

`dartssh` Unhandled exception: Bad state: No element

$ dartssh user@hostname
Unhandled exception:
Bad state: No element
#0      ListQueue.removeFirst (dart:collection/queue.dart:822:25)
#1      SSHClient._authWithNextPublicKey (package:dartssh2/src/ssh_client.dart:827:35)
#2      SSHClient._tryNextAuthMethod (package:dartssh2/src/ssh_client.dart:799:16)
#3      SSHClient._startAuthentication (package:dartssh2/src/ssh_client.dart:771:5)
#4      SSHClient._handleServiceAccept (package:dartssh2/src/ssh_client.dart:501:16)
#5      SSHClient._dispatchMessage (package:dartssh2/src/ssh_client.dart:453:16)
#6      SSHClient._onPacket (package:dartssh2/src/ssh_client.dart:432:7)
#7      SSHTransport._handleMessage (package:dartssh2/src/ssh_transport.dart:639:19)
#8      SSHTransport._processPackets (package:dartssh2/src/ssh_transport.dart:312:7)
#9      SSHTransport._processData (package:dartssh2/src/ssh_transport.dart:257:7)
#10     SSHTransport._onSocketData (package:dartssh2/src/ssh_transport.dart:235:7)
#11     _RootZone.runUnaryGuarded (dart:async/zone.dart:1618:10)
#12     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#13     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#14     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#15     _StreamController._add (dart:async/stream_controller.dart:648:7)
#16     _StreamController.add (dart:async/stream_controller.dart:596:5)
#17     _Socket._onData (dart:io-patch/socket_patch.dart:2314:41)
#18     _RootZone.runUnaryGuarded (dart:async/zone.dart:1618:10)
#19     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#20     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#21     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#22     _StreamController._add (dart:async/stream_controller.dart:648:7)
#23     _StreamController.add (dart:async/stream_controller.dart:596:5)
#24     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1839:33)
#25     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1322:14)
#26     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#27     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#28     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122:13)
#29     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)

Server version: OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

Forward Remote connection does not disconnect when client app disconnect

Following is my connection scenario:
PC 1: listen local:8000. RemoteForwarding:remoteServer 8000 -> local 8000 , and do
//here I launch with another thread
Future.delay(Duration.zero, () async {
await for (final connection in forward.connections) {
final socket = await Socket.connect('localhost', 8000);
connection.stream.cast<List>().pipe(socket);
socket.pipe(connection.sink);
}
}

remoteServer : nginx /connection -> localhost:8000

PC2: ws://remoteServer/connection

When connected , everything works very well. But when PC2 disconnect, the sshd instance on remoteServer does not stop which was still running with 8000 port . This make the forwarding fail for the next time.

I wonder what I should do to enforce the disconnection when client disconnect from the remote server port.

Write on shell

Hi !

Is there a way to write from the code to the shell and not the IDE terminal

I'm implementing the code form the shell example and it works fine:

final shell = await client.shell();
stdout.addStream(shell.stdout);
stderr.addStream(shell.stderr);
stdin.cast<Uint8List>().listen(shell.write);

But I would like to be able to write multiple entry lines from the code to the open shell

Listening to SSH output

Hi,
I'm trying to execute a large python script over ssh, and I want to read all the output without waiting for it to finish executing.
I tried to do it over SSHSession and listening to the output stream but it only trigger the event when the output is finished.
Is there anyway to listed to the output without waiting for the script to finish executing?
Thanks!

Question: Server auth requires keyboard interaction.

I know this is kind of an edge case, however I am trying to log into the sftp server of a piece of equipment I work with, and it requires some sort of keyboard interaction with the cl as part of the password. I have been poking around several different packages, and have not been able to figure out how this works. I was able to sign in using the node library 'ssh2-sftp-client' with the parameter of 'tryKeyboard' set to true. I would really prefer to build this as a flutter app, instead of js. Is there a way in the 'onPasswordRequest' function that I can add this keyboard interaction?

Feature Request: Support KeepAlive Option

Hello. Thanks for creating & developing the dartssh2 project.

I am developing a terminal app with shell interaction using dartssh2.

Are the KeepAliveInterval and KeepAliveCountMax values configurable via dartssh2 options on the client?

I looked for a similar issue below but couldn't find the answer I was looking for.
#27

If not, hopefully a feature will be added in the future.

Regards,


(Please ignore the problem I had below. It was a hardware issue with my development rig.)

When the SSH connection is completed, the connection is forcibly closed after a certain amount of time with the error below.

(An error is displayed when a key input is attempted after a certain amount of time has elapsed.)

E/flutter (21226): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: SSHStateError(Transport is closed)
E/flutter (21226): #0      SSHTransport.sendPacket (package:dartssh2/src/ssh_transport.dart:183:7)
E/flutter (21226): #1      SSHClient._sendMessage (package:dartssh2/src/ssh_client.dart:460:16)
E/flutter (21226): #2      SSHChannelController._sendEOFIfNeeded (package:dartssh2/src/ssh_channel.dart:269:16)
E/flutter (21226): #3      SSHChannelController.close (package:dartssh2/src/ssh_channel.dart:200:5)
E/flutter (21226): #4      SSHClient._closeChannels (package:dartssh2/src/ssh_client.dart:428:15)
E/flutter (21226): #5      SSHClient._onTransportClosed (package:dartssh2/src/ssh_client.dart:447:5)
E/flutter (21226): #6      new SSHClient.<anonymous closure> (package:dartssh2/src/ssh_client.dart:161:23)
E/flutter (21226): #7      _RootZone.runUnary (dart:async/zone.dart:1653:54)
E/flutter (21226): #8      _FutureListener.handleError (dart:async/future_impl.dart:165:22)
E/flutter (21226): #9      Future._propagateToListeners.handleError (dart:async/future_impl.dart:778:47)
E/flutter (21226): #10     Future._propagateToListeners (dart:async/future_impl.dart:799:13)
E/flutter (21226): #11     Future._completeError (dart:async/future_impl.dart:574:5)
E/flutter (21226): #12     Future._asyncCompleteError.<anonymous closure> (dart:async/future_impl.dart:665:7)
E/flutter (21226): #13     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter (21226): #14     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)

Connection code

connect() async {
    final socket = await SSHSocket.connect('host', 'port');

    _client = SSHClient(
      socket,
      username: 'username',
      onPasswordRequest: () {
        return 'password';
      },
    );

    _shell = await _client.shell();
}

pubspec.yarn

dependencies:
  flutter:
    sdk: flutter

  dartssh2: 2.7.3

[SFTP] cannot remove characters from file

Perhaps I missed it when going though the code but I couldn't find a way to remove characters from a file using the SFTP client, other than by truncating the entire file.

Is there a way to do that with this library?

Copy file?

Hi!

I want to copy a file (.tgz) from my host to the server (scp isn't available).

I tried

final session = await client.execute("tar -zxf -");
session.write(filebytes);

but without success. I think the problem is that tar don't know when he should stop listening on stdin.

I got the same result with cat > file.tgz.

Is there a way to copy a file from host to remote without scp?

Thanks for your help!

Looking for server implementation

I would love for the server side of this to be implemented. I tried to see if I could put something together, as I noticed that the SSHTransport class has an "isServer" flag to conditionally act like a client or a server. I got a server kinda working, but when I try to connect with an OpenSSH client, it stalls on debug1: expecting SSH2_MSG_KEX_ECDH_REPLY. I'm really new to the SSH protocol, but I tried figuring out how to construct a reply using one of the kex reply classes, but I got stuck at figuring out what to fill out the fields with.

It looks like the server version of this is really close to working, and I'd help if I understood the SSH protocol more.
I'm looking forward to eventually being able to have my server code respond to plaintext over the ssh connection.
Thanks!

Error when reading '/[C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/dartssh2-2.4.4/lib/next/socket/ssh_socket_js.dart]()': 系统找不到指定的路径。

Hi Owner,

I try to use your ssh2 and found below error,would you pls double check and reply?

Many Thanks.
Zhangmang
[email protected]

Launching lib\main.dart on Chrome in debug mode...
lib\main.dart:1
/C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/dartssh2-2.4.4/lib/src/socket/ssh_socket.dart:4:8: Error: Error when reading '/C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/dartssh2-2.4.4/lib/next/socket/ssh_socket_js.dart': 系统找不到指定的路径。

import 'package:dartssh2/src/socket/ssh_socket_io.dart'
package:dartssh2/…/socket/ssh_socket_io.dart:1
^

/C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/dartssh2-2.4.4/lib/src/socket/ssh_socket.dart:13:18: Error: Method not found: 'connectNativeSocket'.
return await connectNativeSocket(host, port, timeout: timeout);
^^^^^^^^^^^^^^^^^^^

file size is not correct

I am using dartssh2 and I am trying to get the file size with sftp but it displaying 4096 almost all the time sometimes i get another number but still not correct if run the command du -h --max-depth=1 | sort -hr it prints out:

root@test-server:~# du -h --max-depth=1 | sort -hr
44K     .
16K     ./snap
4.0K    ./.ssh
4.0K    ./.cache

but in my program:

image

I am using dartssh2: ^2.7.2+3 and flutter sdk: ">=2.17.6 <3.0.0"

auth with rsa privacy key. but have error: SSHAuthFailError(All authentication methods failed)

this is log:

flutter: SSHTransport._sendKexInit
flutter: SSHTransport._processVersionExchange
flutter: SSHTransport._remoteVersion = "SSH-2.0-OpenSSH_6.4"
2
flutter: SSHTransport._processPackets
flutter: SSHTransport._consumeClearTextPacket
flutter: SSHTransport._handleMessageKexInit
flutter: SSHTransport._kexType: SSHKexType(ecdh-sha2-nistp521)
flutter: SSHTransport._hostkeyType: SSHHostkeyType(ssh-rsa)
flutter: SSHTransport._clientCipherType: SSHCipherType(aes128-ctr)
flutter: SSHTransport._serverCipherType: SSHCipherType(aes128-ctr)
flutter: SSHTransport._clientMacType: SSHMacType(hmac-sha1)
flutter: SSHTransport._serverMacType: SSHMacType(hmac-sha1)
flutter: SSHTransport._sendKexDHInit
flutter: SSHTransport._processPackets
flutter: SSHTransport._consumeClearTextPacket
flutter: SSHTransport._handleMessageKexReply
flutter: SSHTransport._consumeClearTextPacket
flutter: SSHTransport._handleMessageNewKeys
flutter: SSHTransport._sendNewKeys
flutter: SSHClient._onTransportReady
flutter: SSHClient._requestAuthentication
flutter: SSHTransport._processPackets
flutter: SSHTransport._consumeEncryptedPacket
flutter: SSHClient._startAuthentication
flutter: SSHClient._tryNextAuthenticationMethod
flutter: _currentAuthMethod = SSHAuthMethod.publicKey
flutter: SSHClient._authWithPublicKey
flutter: SSHTransport._processPackets
flutter: SSHTransport._consumeEncryptedPacket
flutter: SSHClient._handleUserauthFailure
flutter: SSHClient._tryNextAuthenticationMethod
flutter: _currentAuthMethod = SSHAuthMethod.none
flutter: SSHClient._authWithNone
flutter: SSHTransport._processPackets
flutter: SSHTransport._consumeEncryptedPacket
flutter: SSHClient._handleUserauthFailure
flutter: SSHClient._tryNextAuthenticationMethod
flutter: SSHTransport.closeWithError SSHAuthFailError(All authentication methods failed)

I try to use FileZilla to connect, it's fine.
So I don't know where I'm going wrong

Local port forwarding

I tested the local port forwarding feature, but cannot get it running.

SSH Command I want to run: ssh 172.17.0.2 -l root -L 1234:localhost:80
With the dart client: dart run dartssh.dart -l root 172.17.0.2 --debug --password test --tunnel localhost:80

Is my command right at this point?

It says tunnel is up, but curl 127.0.0.1:1234 responds connection refused.

Feature Request: Host Key Verification

Hello. I wonder if there are any plans to implement Host Key Verification function. (Server host key can be returned, whether to connect through server host key acceptance)

As in the following ssh2.js (SSH client implemented in JavaScript) hostVerifier example, I would like to be given a server hash to compare against, and handle the process of accepting or rejecting connections via a callback.

https://github.com/mscdex/ssh2#:~:text=Default%3A%20(none)-,hostVerifier,-%2D%20function%20%2D%20Function

If this is not currently possible, it would be nice if implemented in the future.

Regards,

SSH with proxy

Hello,
Is there a way to make SSH use a proxy?
like socks or http

Killing the session results in an internal unhandled exception

Example:

import 'dart:io';
import 'package:dartssh2/dartssh2.dart';

void main() async {
  var client = SSHClient(
    await SSHSocket.connect("192.168.0.1", 22),
    username: "root",
    onPasswordRequest: () => "mypass",
  );

  final session = await client.execute('sleep 10');
  stdout.addStream(session.stdout);
  stderr.addStream(session.stderr); 
  
  session.done.then((_) {
    print("session done");
    client.close();
  }).catchError((err) {
    print("session errored");
    client.close();
  });

  await Future.delayed(Duration(seconds: 2));
  session.kill(SSHSignal.INT);
}

Alternatively:

import 'dart:io';
import 'package:dartssh2/dartssh2.dart';

void main() async {
  var client = SSHClient(
    await SSHSocket.connect("192.168.0.1", 22),
    username: "root",
    onPasswordRequest: () => "mypass",
  );

  final session = await client.execute('sleep 10');
  stdout.addStream(session.stdout);
  stderr.addStream(session.stderr); 
  
  await Future.delayed(Duration(seconds: 2));
  session.kill(SSHSignal.INT);

  await session.done;
  client.close();
}

Will both result in this exception being thown:

Unhandled exception:
Null check operator used on a null value
#0      SSHSession._handleRequest (package:dartssh2/src/ssh_session.dart:119:41)
#1      SSHChannelController._handleRequestMessage (package:dartssh2/src/ssh_channel.dart:234:36)
#2      SSHChannelController.handleMessage (package:dartssh2/src/ssh_channel.dart:185:7)
#3      SSHClient._handleChannelRequest (package:dartssh2/src/ssh_client.dart:705:42)
#4      SSHClient._dispatchMessage (package:dartssh2/src/ssh_client.dart:489:16)
#5      SSHClient._onPacket (package:dartssh2/src/ssh_client.dart:432:7)
#6      SSHTransport._handleMessage (package:dartssh2/src/ssh_transport.dart:639:19)
#7      SSHTransport._processPackets (package:dartssh2/src/ssh_transport.dart:312:7)
#8      SSHTransport._processData (package:dartssh2/src/ssh_transport.dart:257:7)
#9      SSHTransport._onSocketData (package:dartssh2/src/ssh_transport.dart:235:7)
#10     _RootZone.runUnaryGuarded (dart:async/zone.dart:1620:10)
#11     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#12     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#13     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#14     _StreamController._add (dart:async/stream_controller.dart:607:7)
#15     _StreamController.add (dart:async/stream_controller.dart:554:5)
#16     _Socket._onData (dart:io-patch/socket_patch.dart:2166:41)
#17     _RootZone.runUnaryGuarded (dart:async/zone.dart:1620:10)
#18     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#19     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#20     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#21     _StreamController._add (dart:async/stream_controller.dart:607:7)
#22     _StreamController.add (dart:async/stream_controller.dart:554:5)
#23     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1702:33)
#24     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1213:14)
#25     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#26     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#27     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:120:13)
#28     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)

The problem also happens with shell.kill(), and won't happen if you dont use the .done promise

sftp: FormatException: Unexpected extension byte (at offset 0)

The following code fails on stat or open. The sftp site is a site with public access. I am able to test the site access with FileZilla without any issues. The same behavior on both Linux and Windows.

import 'package:dartssh2/dartssh2.dart';

void main(List<String> args) async {
  final socket = await SSHSocket.connect('sftp.floridados.gov', 22);

  final client = SSHClient(
    socket,
    username: 'Public',
    onPasswordRequest: () => 'PubAccess1845!',
    onAuthenticated: () => print('*** Signed in'),
    printTrace: (msg) => print('TRACE: $msg'),
    printDebug: (msg) => print('DEBUG: $msg'),
  );

  final sftp = await client.sftp();
  print('*** Before calling stat');
  final stat = await sftp.stat('/');

  print(stat.size);
  print(stat.mode);

  client.close();
  await client.done;
}

StackTrace:

Unhandled exception:
FormatException: Unexpected extension byte (at offset 0)
#0      _Utf8Decoder.convertSingle (dart:convert-patch/convert_patch.dart:1755:7)
#1      Utf8Decoder.convert (dart:convert/utf.dart:351:42)
#2      Utf8Codec.decode (dart:convert/utf.dart:63:20)
#3      SSHMessageReader.readUtf8 (package:dartssh2/src/ssh_message.dart:75:17)
#4      new SftpVersionPacket.decode (package:dartssh2/src/sftp/sftp_packet.dart:105:28)
#5      SftpClient._handleVersionPacket (package:dartssh2/src/sftp/sftp_client.dart:410:38)
#6      SftpClient._handlePacket (package:dartssh2/src/sftp/sftp_client.dart:392:16)
#7      SftpClient._handlePackets (package:dartssh2/src/sftp/sftp_client.dart:384:7)
#8      SftpClient._handleData (package:dartssh2/src/sftp/sftp_client.dart:374:5)
#9      _RootZone.runUnaryGuarded (dart:async/zone.dart:1618:10)
#10     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#11     _DelayedData.perform (dart:async/stream_impl.dart:591:14)
#12     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
#13     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7)
#14     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#15     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#16     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122:13)
#17     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)

Create and Write to file

Hi, I was trying to create a text file and write to it. However, every time I run the test, I was able to create the file or write to the file but got an error when I wanted to create and write to it. Below is my example.

void main() {
test('', () async {
final socket = await SSHSocket.connect('localhost', 22);

final client = SSHClient(
  socket,
  username: 'yh',
  onPasswordRequest: () => 'secret',
);

final sftp = await client.sftp();
await sftp.open(
  'asdf.txt',
  mode: SftpFileOpenMode.create,
);

final file1 = await sftp.open('asdf.txt', mode: SftpFileOpenMode.write);
final lists = 'asdfasdf'.codeUnits;
await file1.writeBytes(Uint8List.fromList(lists));

client.close();
await client.done;

});
}

vim scroll up display error

In vim normal mode, first move cursor down to file bottom, then use key K to move cursor up. When cursor hit the line 5 of the screen, display start error, only first line changes, other lines remain unchanged.

Socket Support on Web broken

I am fairly new to flutter and trying to implement a simple ssh-client in a terminal view. However when I test it on web, I get errors along the lines of

Error: UnimplementedError: Native socket is not supported on web

So, I am not handling the error, but the actual error could maybe be fixed following the comments in the bug report to flutter/flutter: flutter/flutter#45982 (comment) which should, to my understanding, be implemented in the following line:

final socket = await Socket.connect(host, port, timeout: timeout);

my code for the ssh connections looks as follows:

    final client = SSHClient(
      await SSHSocket.connect(host, port),
      username: username,
      onPasswordRequest: () => password,
    );

Connection blocks main thread

For some reasons the use of dartssh2 blocks the main thread of my flutter application. This happens when I connect to the server and when I run a simple command on the server e.g. cat file.txt which is very small (like 100 characters). I run my application with a debugger and stopped it during the hangs. For the connection it seems that the loading of the ssh key takes quite some time, for the cat I not that sure.

Since dart has just one thread und there are no async calls in between, the main application hangs. Is there something I can to to prevent the hangs?

Connect to the server:
F (bcrypt.dart:1242)
Blowfish.encipher (bcrypt.dart:1154)
Blowfish.expand0state (bcrypt.dart:1193)
bcrypt_hash (bcrypt.dart:1267)
bcrypt_pbkdf (bcrypt.dart:1343)
OpenSSHKeyPairs._decryptPrivateKeyBlob (ssh_key_pair.dart:213)
OpenSSHKeyPairs.getPrivateKeys (ssh_key_pair.dart:138)
SSHKeyPair.fromPem (ssh_key_pair.dart:24)
ServerConnection._connect (connection.dart:23)

Run command cat:
int.+ (integers.dart:8)
TweetNaCl._M_off (tweetnacl.dart:1184)
TweetNaCl._M (tweetnacl.dart:803)
TweetNaCl.crypto_scalarmult (tweetnacl.dart:1394)
TweetNaCl.crypto_scalarmult_base (tweetnacl.dart:1416)
_ScalarMult.scalseMultBase (kex_x25519.dart:63)
new SSHKexX25519 (kex_x25519.dart:18)
SSHTransport._handleMessageKexInit (ssh_transport.dart:714)
SSHTransport._handleMessage (ssh_transport.dart:637)
SSHTransport._processPackets (ssh_transport.dart:317)
SSHTransport._processVersionExchange (ssh_transport.dart:300)
SSHTransport._processData (ssh_transport.dart:257)
SSHTransport._onSocketData (ssh_transport.dart:237)
_rootRunUnary (zone.dart:1434)
_CustomZone.runUnary (zone.dart:1335)
_CustomZone.runUnaryGuarded (zone.dart:1244)
_BufferingStreamSubscription._sendData (stream_impl.dart:341)
_BufferingStreamSubscription._add (stream_impl.dart:271)
_SyncStreamControllerDispatch._sendData (stream_controller.dart:774)
_StreamController._add (stream_controller.dart:648)
_StreamController.add (stream_controller.dart:596)
_Socket._onData (socket_patch.dart:2314)
_rootRunUnary (zone.dart:1442)
_CustomZone.runUnary (zone.dart:1335)
_CustomZone.runUnaryGuarded (zone.dart:1244)
_BufferingStreamSubscription._sendData (stream_impl.dart:341)
_BufferingStreamSubscription._add (stream_impl.dart:271)
_SyncStreamControllerDispatch._sendData (stream_controller.dart:774)
_StreamController._add (stream_controller.dart:648)
_StreamController.add (stream_controller.dart:596)
new _RawSocket. (socket_patch.dart:1839)
_NativeSocket.issueReadEvent.issue (socket_patch.dart:1322)
_microtaskLoop (schedule_microtask.dart:40)
_startMicrotaskLoop (schedule_microtask.dart:49)

SSHAuthAbortError(Connection closed before authentication)

I've vsftp hosted on my vps but whenever I try to connect via sftp it shows this err.

Tue Apr 26 03:08:58 2022 [pid 8454] CONNECT: Client "::ffff:ip>"

this is all it shows in the log, I tried to connect with filezilla by copy pasting ip, port, username and pw and it worked perfectly so there isn't any mistake in credentials.

The dart code is same as documented

final sftp = await client.sftp();
final items = await sftp.listdir('/');
for (final item in items) {
print(item.longname);
}

error code 4 when I try to upload a file via sftp

I'm try to upload some data from my the smartphone to a server via sftp.
However, I keep on receveing an exception with the error code 4. The error message is only "failure", so it's pretty hard for me to understand what is going on.

I'm able to connect to the server and to create folders, but the upload itself is not working. The code itself is copied from your readme page. Both variables, serverPath and localFilePath are valid paths.

    final file = await sftp.open(serverPath, mode: SftpFileOpenMode.create | SftpFileOpenMode.write);
     await file.write(File(localFilePath).openRead().cast());

thank you and best regards.

file not found

Hello, I want to use sftp to upload files, but I don't know how to fill in the path selection of the file

Halting when uploading 0 bytes files.

When attempting to SFTP upload an empty file (with 0 bytes in size) the upload halts (neither raises an error, no exits the program).

The client machine where the program is executes is Windows the remote one is Amazon Linux 2.

One might wonder what is the use case for such files. Sometime programs create programx.lock files which are used as a persisted on file system boolean switch.

Output of remote "tail - f"

Can someone please provide an example of gathering a continuous stream of string lines from a remotely executed "tail - f"?

Web Support?

I am surprised that web support is listed on pub.dev.

AFAIK, browser extensions are currently required to make ssh connections. I shall look into the web socket code but perhaps you wouldn't mind explaining what is possible for flutter for web?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.