GNOME Bugzilla – Bug 556670
Cannot import a SSH key from a file
Last modified: 2009-12-07 07:57:12 UTC
Seahorse cann't import ssh key from a ssh key file. This is because Seahorse looks the file as a PGP key file. 1. I exported a SSH key to a file with the extension .asc, for example, aa.asc 2. xdg-mime query filetype aa.asc the result is application/pgp-encrypted, in fact, it should be "application/x-ssh-key". so seahorse_util_detect_data_type returns an incorrect data type.
Created attachment 121956 [details] [review] Make importing SSH keys work on Solaris. By default, the mime type of the imported file is SEAHORSE_SSH. Since PGP is not supported on Solaris, just return it directly. Do you have better fix for this?
The way this works in GNOME is that we've installed a mime type for application/x-ssh-key. I'm not sure how mime types work in Solaris, but you may want to patch that with some of the xml from seahorse-plugins/plugins/nautilus/seahorse.xml.
there is a bug similar on https://bugs.edge.launchpad.net/bugs/321997 "Binary package hint: seahorse Public SSH keys can't be imported into Seahorse, either copying or from the File dialog. When copying any public key from Launchpad directly in the "Trusted keys" tab, the key is somehow changed or interpreted as an OpenPGP key. When tyring to import it via the File > Import dialog in Hardy there is an "Invalid file format" error. The file I try to import is named "pubkey.asc", saved using the "Save this page" feature in Firefox when displaying public keys in Launchpad. When tyring to import it via the File > Import dialog in Intrepid it silently fails. This may be related to Bug #150654 , Bug #230537 or both. I am filing a new bug as I am only interested in public keys importing, as a part of setting up public key authentication for SSH access/tunneling."
Import needs a complete overhaul and we hope to have that completed for 2.28.
Nautilus can recognize the file as 'ssh-key-file' while xdg-mime cannot. Seahorse should use the same method as Nautilus to get the file type.
Nautilus uses g_file_info_get_content_type while seahorse uses g_content_type_guess.
Created attachment 145912 [details] [review] Use g_file_info_get_content_type This patch can fix the error that happens when a user imports a SSH key file. But it doesn't fix the issue when importing from the clipboard.
Review of attachment 145912 [details] [review]: Looks good. We should commit this after gnome-2-28 branch.
Committed to HEAD.
(In reply to comment #9) > Committed to HEAD. Hello Jeff. I have tried but it still doesn't work for me. The status bar says "Imported keys" but they are not shown. Does it work for you?
The key is imported to the other category.