Can't import pubkeys with passphrase properly
See original GitHub issueBug description
I can’t import a pubkey with passphrase created on my mac to connectbot properly. Pubkey with no passphrase is working normally.
Steps to reproduce
on Mac
❯ ssh-keygen -t rsa -C mbp2016 -f ~/.ssh/id_with_passphrase
enter “password” as passphrase
id_with_passphrase
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABDfgSeBuI
XCZKYbH8rUrCgIAAAAEAAAAAEAAAEXAAAAB3NzaC1yc2EAAAADAQABAAABAQDTBLWJWhnX
/G8Ub5W7U5/b9TsEzya4v96R+O/3G0dPXCcJ/aprhGA/qL0sf1TNJtPkanJ6EyMNR2wiIG
4xU07o72cvZoYlopx5rc7KxTwGcQgYkNcdA+mzX5dvNiwOgLU9qQ1ZoIXSi6UGqYcpgD/7
OyCGifuGag+KxKI/r4LIHmk9f53jn2sXIqB4f8XECYla0j9ra8c5T0iPLMGGSXegokVJ4b
0hLZX+fCLEMiNxYfSAGWIPsm+jcLeTUkjCvPknfECkP9FB27WWDYzlSaNnD9IG7d93FUF5
hAERQKbhpDNdy5EJbqX2nZ44L531h470Gd7DqsIzZ+MlNVM5QTHnAAADwPLaRW9NKUankz
GEYgz9ZDfTpYtDJh7uzsNisXq1C8A+mzvRSuho2OGT77WIF5GDQREbikxZy8KU77YXkj6g
9IGQ3TL5eERAGDMcfFq+5kfUCMd1pgXNp00P2By8mKrV434rpr9FRet7oawJNO2EE6HR2e
/4KfrnoxIXrDu+GCARiGDYsJ0jsrMRblDsryCOuyZgbxPLcOJp0f+chb5E7lceQG+3QxLr
ptpEC58P+MTg5EudB3VkIBhQSP3C+O2eIsQb9cOFzVSLITkd2PvZEGxt4NVTH/pXnS7tvj
JW+glMcpnMWA3eVe95HUGD+hgE6YJ3cZnf2NnYUWDDqvldcY6vy38b/1dMRjPAFur10MmZ
/uKwNrZVshhrlL6O8zsrdOQ01pxL7+MjiWZfwSRC5/pB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dvNiwOgLU9qQ1ZoIXSi6UGqYcpgD/7OyCGifuGag+KxKI/r4LIHmk9f53jn2sXIqB4f8XECYla0j9ra8c5T0iPLMGGSXegokVJ4b0hLZX+fCLEMiNxYfSAGWIPsm+jcLeTUkjCvPknfECkP9FB27WWDYzlSaNnD9IG7d93FUF5hAERQKbhpDNdy5EJbqX2nZ44L531h470Gd7DqsIzZ+MlNVM5QTHn mbp2016
- copy id_with_passphrase to /sdcard/SSH
- Open Connectbot app, Go to Manege Pubkeys, And import the key.
- Click the imported key, and enter the password and tap ‘unlock key’
- Toast “Bad password for key 'primary:SSH/id_with_passphrase. Authentication failed” appeared and can’t open the key properly.
Screenshots
- first key is created by mac with passphrase. not working.
- second key is created by mac with no passphrase. working.
- third key is created by Connectbot with passphrase. working fine.
Android device
- Device: Galaxy S8
- OS: Android 8.0.0
- ConnectBot Version: latest 1.9.5
Mac
- OS: macOS Mojave 10.14.2
- SSH Software and Version: OpenSSH_7.9p1, LibreSSL 2.7.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:12
Top Results From Across the Web
Pgp public and private keys not importing : r/tails - Reddit
When I go back to password and keys I see the public key in my list ... up o get doesn't list the...
Read more >GPG Keychain: Unable to import public keys
I cant seem to import any public keys. ... As you correctly describe, GPG Keychain is the key manager for your OpenPGP keys....
Read more >Unable to import public keys in Thunderbird 91.4.1, get error ...
I received an "OpenPGP Alert" window reading "Can't read public key file. undefined". The key was not imported. Error console message reads: "Failed...
Read more >1405361 – [RHEL6] RSA-{E,S} public keys cannot be imported
Bug 1405361 - [RHEL6] RSA-{E,S} public keys cannot be imported ... release flag has been set to ? to ensure that it is...
Read more >Importing private SSH keys fails - MikroTik - Forum
However, I can't import the keys in the first place. ... Also generating keys with a passphrase and entering it does not work....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
the same issue has not been solved for so long.
Same issue with private key generated by Putty.