veeso / termscp

🖥 A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3/SMB
https://termscp.veeso.dev
MIT License
1.49k stars 45 forks source link

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

Closed Halifuda closed 1 year ago

Halifuda commented 1 year ago

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 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.

veeso commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

veeso commented 1 year ago

duplicate of #128