Skip to content
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

[QUESTION] - Unable to use RSA keys on win11 #160

Closed
Halifuda opened this issue Apr 1, 2023 · 4 comments
Closed

[QUESTION] - Unable to use RSA keys on win11 #160

Halifuda opened this issue Apr 1, 2023 · 4 comments
Assignees
Labels
question Further information is requested sorcery for those things which are kinda unexplainable

Comments

@Halifuda
Copy link

Halifuda commented Apr 1, 2023

Hello! I have tried termscp and found it awesome. But when I try to connect to a server by RSA key authentification, I failed.
Some basic infos:

  • I'm on Win11 and OpenSSH;
  • I can connect to that server by raw ssh and sftp command, password and RSA key both;
  • I can connect to the server by password in termscp;
  • termscp reported could not find any suitable RSA key to authenticate with when I try to use RSA key;
  • in log file it says (IPaddr omitted):
2023-04-01T12:27:50.9831439Z [INFO] Client is not connected to remote; connecting to***.***.***.***:XXXX
2023-04-01T12:27:51.2634982Z [ERROR] Authentication failed: [Session(-1)] unknown error
2023-04-01T12:27:55.2524085Z [INFO] FileTransferActivity terminated due to 'Authentication'

I have tried to solve this problem by:

  • change server addr, including alias in .ssh/config, raw ip, ip with port (...:X), I have changed in both bookmark and key storage;
  • change the content of key file, including add or remove the START and END (the doc says use private key so I didnot give termscp the public key);
  • re-edit the toml files in termscp storage.

I found termscp useful, but that server will likely ban password in a few weeks. Could you tell the cause and solution, and (if necessary) update doc? I found the doc says little about the usage of key.

@Halifuda Halifuda added the question Further information is requested label Apr 1, 2023
@veeso
Copy link
Owner

veeso commented Apr 3, 2023

You should try to run termscp with -D option to have the debug log to see what is trying to use as a key. It depends on the configuration and this sometimes is causing issues. I suggest anyway to add the key directly into termscp from the configuration, which always works.

@Halifuda
Copy link
Author

Halifuda commented Apr 4, 2023

Thanks for your reply, however, I failed to workaround:
When I specify the key path in config.toml, and run with -D, I got (time and username are omiteed):

[TRACE] (1) remotefs_ssh::ssh::commons: [C:\Users\ME\.cargo\registry\src\github.com-1ecc6299db9ec823\remotefs-ssh-0.1.3\src\ssh\commons.rs:135] Configuring algorithm preferences...
[DEBUG] (1) remotefs_ssh::ssh::commons: Authenticating with username 'USER' and RSA key
[TRACE] (1) remotefs_ssh::ssh::commons: [C:\Users\ME\.cargo\registry\src\github.com-1ecc6299db9ec823\remotefs-ssh-0.1.3\src\ssh\commons.rs:208] Trying to authenticate with RSA key at 'KEYPATH'
[ERROR] Authentication failed: [Session(-1)] unknown error
[INFO] FileTransferActivity terminated due to 'Authentication'

I looked the src in remotefs, I found it can successfully locate my key. The error seems in ssh2 crate, which cannot load the key.
I have move the key file to several different places, and I even replace it with unexisting file, but the ERRORs remain the same. It seems like a bug in ssh2?

@veeso
Copy link
Owner

veeso commented Apr 4, 2023

Yeah, it looks like an unsupported RSA key for some reason. Indeed the error is unknown

@veeso veeso added the sorcery for those things which are kinda unexplainable label Apr 4, 2023
@veeso
Copy link
Owner

veeso commented Apr 11, 2023

duplicate of #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested sorcery for those things which are kinda unexplainable
Projects
None yet
Development

No branches or pull requests

2 participants