-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auth with rsa privacy key. but have error: SSHAuthFailError(All authentication methods failed) #49
Comments
The same problem as you, "All authentication methods failed" |
same error, any solution?
|
I can use the same key file to connect on FileZilla, or directly using SSH: ssh root@10.64.20.141 -p 1922 -i /home/username/id_rsa -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa My dart code here: import 'dart:convert';
import 'dart:io';
import 'dart:async';
import 'package:dartssh2/dartssh2.dart';
Future<void> main() async {
final client = SSHClient(
await SSHSocket.connect('10.64.20.141', 1922),
username: 'root',
identities: [
// A single private key file may contain multiple keys.
...SSHKeyPair.fromPem(await File('/home/username/id_rsa').readAsString())
],
printDebug: print,
printTrace: print,
);
print(utf8.decode(await client.run("ls -lah /home")));
client.close();
return;
} My log here:
|
Is there any way to specify |
It looks like |
I also encountered the same problem. Is there any solution now? |
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
The text was updated successfully, but these errors were encountered: