GNOME Bugzilla – Bug 424473
can't import ssh key created from ssh-keygen
Last modified: 2007-10-09 13:58:52 UTC
Please describe the problem: I have an ssh key that I created several months ago with ssh-keygen. I use it for almost a hundered servers to login so I know it must be a good key. It's RSA, I think I made it 4096 bits. I wanted to give seahorse a shot, so I tried to import my key. When I navigate to ~/.ssh, it doesn't show me any files. I've got both my private and public key there so it should be seeing *something*! I go ahead and type the id_rsa filename maually and click ok. I get a dialog: Couldn't import keys file:///home/<username>/.ssh/id_rsa: Invalid file format Even if ssh-keygen did something weird when generating this key I think it might be good for seahorse to include a work-around for it. The only thing I can think of that might be wrong is that there's no preamble in the key file before the line which announces the beginning of the key. Am I doing something obviously wrong here, or is this key badly formed somehow? This is seahorse 1.0 in feisty. The key was probably generated back when I was running Dapper, I have no idea what version of openssh that would have been :-/ Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Could you generate a new key for testing purposes (which you'll never use), in exactly the same way as you generated the problematic one. And then post that key here? That'll help us find the problem. Thanks!
Created attachment 85796 [details] an example private key meyerm@meyerm:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/meyerm/.ssh/id_rsa): /home/meyerm/id_rsa_example Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/meyerm/id_rsa_example. Your public key has been saved in /home/meyerm/id_rsa_example.pub. The key fingerprint is: f4:72:c7:8b:91:d4:15:c1:65:c5:fc:02:93:ee:2a:11 meyerm@meyerm I'll attach the public key momentarily. I checked and this key generates the same error for me when I try to import it.
Created attachment 85797 [details] public key for the private key This is the public key that goes with that private key. There is no passphrase on the private key. This one didn't seem to import either but I didn't get an error message. Could be related to bug 395833, not sure.
Thanks. Fixed committed to gnome-2-18 branch. This fix will be included in seahorse 1.0.1 2007-04-07 Nate Nielsen <nielsen@memberwebs.com> * libseahorse/seahorse-ssh-key-data.c: * libseahorse/seahorse-util.c: * plugins/nautilus/seahorse.xml: Enable importing of plain SSH keys, generated elsewhere. Fixes bug #424473 Commit: 1717
This is interesting. I have Seahorse 1.0.1 in Feisty now. I can import that example I uploaded but I still can't import any of my three private keys for some reason. All three of them seem to be exactly the same format. Short of uploading one of my own keys is there any other way to figure out what's wrong?
seahorse uses the freedesktop.org mimetypes to figure out the key types (the same ones shown by nautilus). What mime types are shown for your key files? Sometimes it takes logging out and logging in to make sure the mimetype info is current.
This should now be fixed. See bug #429509
This is still not working for me and I'm now using Seahorse 2.20. For some reason my key is detected as type text/x-vhdl. That seems wrong, so the questions abound! 1. What mime type should the key be detected as? 2. What library is responsible for deciding the mime type? 3. How does this library go about determining the type? 3. Is there some cache that I can clear to make it re-check the type?
(In reply to comment #8) > 1. What mime type should the key be detected as? Nautilus detects my ssh keys as application/x-ssh-key > 2. What library is responsible for deciding the mime type? shared-mime-info is the freedesktop.org project. Seahorse installs the x-ssh-key type in a xml file to /usr/share/mime/packages/seahorse.xml > 3. How does this library go about determining the type? It looks at the globs (file extensions) and file contents based on specifications in the xml files in the packages directory > 3. Is there some cache that I can clear to make it re-check the type? as root: update-mime-database /usr/share/mime Then refresh your nautilus windows.
I may have found the problem: I don't have the seahorse.xml file on my system. Apt is showing that the directory /usr/share/mime/packages is part of the package, but not actually the xml file. I'll report this downstream with Ubuntu. Thanks for the info!
Might make sense to file a bug on shared-mime-info for including that mime type there too...
I just opened fd.o bug 12752 (https://bugs.freedesktop.org/show_bug.cgi?id=12752) against shared-mime-info. I wanted to include a link to the appropriate file in SVN but I couldn't find it :-( Also, for reference, the Ubuntu bug I filed was LP 150654 (https://bugs.launchpad.net/ubuntu/+source/seahorse/+bug/150654).
Given that a proper installation of seahorse correctly register the appropriate mime-types, I'm not sure there is much point of adding those definitions to shared-mime-info (unless they are general enough to be useful for other apps).
The file is located at http://svn.gnome.org/viewvc/seahorse/trunk/plugins/nautilus/seahorse.xml?view=markup