After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 424473 - can't import ssh key created from ssh-keygen
can't import ssh key created from ssh-keygen
Status: RESOLVED FIXED
Product: seahorse
Classification: Applications
Component: general
1.0
Other All
: Normal normal
: 2.20.0
Assigned To: Seahorse Maintainer
Seahorse Maintainer
Depends on:
Blocks:
 
 
Reported: 2007-03-30 13:41 UTC by Martin Meyer
Modified: 2007-10-09 13:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
an example private key (1.64 KB, text/plain)
2007-04-04 13:32 UTC, Martin Meyer
Details
public key for the private key (395 bytes, text/plain)
2007-04-04 13:34 UTC, Martin Meyer
Details

Description Martin Meyer 2007-03-30 13:41:22 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:
Comment 1 Stef Walter 2007-04-03 16:13:38 UTC
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!
Comment 2 Martin Meyer 2007-04-04 13:32:07 UTC
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.
Comment 3 Martin Meyer 2007-04-04 13:34:27 UTC
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.
Comment 4 Stef Walter 2007-04-07 16:06:41 UTC
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
Comment 5 Martin Meyer 2007-04-12 00:27:08 UTC
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?
Comment 6 Stef Walter 2007-04-13 17:50:13 UTC
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.
Comment 7 Stef Walter 2007-04-13 22:19:05 UTC
This should now be fixed. See bug #429509
Comment 8 Martin Meyer 2007-10-08 17:11:04 UTC
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?
Comment 9 Adam Schreiber 2007-10-08 17:31:13 UTC
(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.

Comment 10 Martin Meyer 2007-10-08 18:18:49 UTC
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!
Comment 11 Sebastian Dröge (slomo) 2007-10-09 05:17:56 UTC
Might make sense to file a bug on shared-mime-info for including that mime type there too...
Comment 12 Martin Meyer 2007-10-09 13:45:45 UTC
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).
Comment 13 Christophe Fergeau 2007-10-09 13:48:27 UTC
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).
Comment 14 Adam Schreiber 2007-10-09 13:58:52 UTC
The file is located at http://svn.gnome.org/viewvc/seahorse/trunk/plugins/nautilus/seahorse.xml?view=markup