LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 08-19-2009, 07:18 PM   #1
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 448

Rep: Reputation: 34
Seahorse "Invalid file format" when importing key


Can someone help me out with why I can't import one of my SSH keys in to Seahorse? I get the following error when I try:
Quote:
Couldn't import keys
file:///home/fukawi2/.ssh/privatekey_nwb.dsa: invalid file format
Without posting my private key, here's the format:
Quote:
-----BEGIN DSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,F44490FC03F38597

<KEY GOES HERE>
-----END DSA PRIVATE KEY-----
Opening this key using ssh-add works fine, but that's getting annoying having to do that everytime I login.

Gnome 2.26 w/ Seahorse 2.26.2
 
Old 08-21-2009, 09:28 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
How did you generate this key? The filename & format look foreign.
Code:
-----BEGIN DSA PRIVATE KEY-----
MIIBuwIBAAKBgQDEcedpBxtWVumvdBIFBR+QEm+2jM5L/jfY0IgPeHq3V47Ges5Y
8fcJYedKHlQEpuJ7HPP4raMCuzgRmbVcbIOjYJQ75UIXpWkh5/HRQawfBfSJenSx
rUJG9RojeMavnibWyEwL6yf6MjtmuZEssQaU5h+9kNKKN6Pjiw4iqiV/VwIVANjC
eXwmpFgQiEsPsRCNAvQvVEUdAoGADufQdvenea2HBtNlI/4jMceBT9Vmq6mfC0ee
PR1vJNyDmEaLbndvyrgeb1EJ1c4EQFA4VC4EbO8vywlUfaJQKaJr9oFVRGfXspF4
DKv19AyZWtYtn+aYBBII60h/dkSbXuBbaFxLU1a+fk9sURRKs1G7TDWxcg1lMdmz
nNOcAUQCgYEAjpZOXcZ7G0D6M9ziPhStPQ/5vhsWA3TckJiJPyFW3i6I3S//dtnz
n1IIR09Ds0lzYTKi3aWbP6/kHhN8Y+nCkpMBpYjaQP8vpKQNaNVnq/P7E4vI2Zi3
gy3yZlLbvCw38Jyb5b7jYK/n7AH4bZjr+/EhHrgzJLMuChrIVafJwbYCFEtjVvtb
N5NOFrAnE/XrvtF7o8eI
-----END DSA PRIVATE KEY-----
I generated a temporary key for this post using "ssh-keygen -t dsa -b 1024".
The ssh-keygen program can import some keys from commercial products and convert them to an ssh2 format.
 
Old 08-23-2009, 07:12 PM   #3
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 448

Original Poster
Rep: Reputation: 34
I tried this, redirecting to a new file but the new file still can't be imported because of the same error.
Code:
fukawi2 ~  $ ssh-keygen -e -f .ssh/privatekey_nwb.dsa 
Enter passphrase: 
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "2048-bit DSA, converted from OpenSSH by fukawi2@desktop"
AAAAB3Nza<REST OF KEY HERE>
---- END SSH2 PUBLIC KEY ----
EDIT: the key was generated for me by my boss who manages all that stuff...
 
Old 08-24-2009, 05:17 AM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
I generated another temp dsa key. The form looks just like the one from your original post.

Look at the default .xinitrc file, possibly from /etc/skel/.xinitrc-sample.
Code:
# run Xmodmap settings
xmodmap $HOME/.Xmodmap

#
# Uncomment next lines to activate asking for ssh passphrase
#
# if test -S "$SSH_AUTH_SOCK" -a -x "$SSH_ASKPASS"; then
#       ssh-add < /dev/null
# fi

#
# Add your own lines here...
#
This will allow you to enter the passphrase once when you log in to any destop environment you have setup.
If you use gdm or xdm, grep the config files for ssh-agent or usessh. This would allow you to run ssh-add when you log in and not need to do it again every time you open a new terminal. I had tried putting similar code in .profile but for some reason, I would be prompted twice.

Last edited by jschiwal; 08-24-2009 at 05:47 AM.
 
Old 08-24-2009, 05:20 AM   #5
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 448

Original Poster
Rep: Reputation: 34
I don't think so -- everything we do / use is Linux-based. We have our own internal distribution based off FC6 and AFAIK it's just standard OpenSSL / OpenSSH. I'll check with him though.
 
Old 08-24-2009, 06:09 AM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Sorry, I discovered my own post was wrong and changed it on you.
It looks like seahorse doesn't handle the ssh-agent key. Using ssh-agent on login should work out just as well.
 
Old 08-24-2009, 07:36 PM   #7
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 448

Original Poster
Rep: Reputation: 34
Thanks -- I didn't have an .xinitrc so I copied from /etc/skel/ but it didn't have anything about SSH ask pass. I've copied and pasted from your post so I'll see how that goes
 
Old 08-26-2009, 03:37 AM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
I don't know if this will help, but here is the pstree output leading to ssh-agent on my laptop.

Code:
|-kdm-+-Xorg
     |     `-kdm---startkde-+-gpg-agent
     |                      |-kwrapper4
     |                      `-ssh-agent
A fragment of startkde
Code:
# Source scripts found in <localprefix>/env/*.sh and <prefixes>/env/*.sh
# (where <localprefix> is $KDEHOME or ~/.kde, and <prefixes> is where KDE is installed)
#
# This is where you can define environment variables that will be available to
# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
# or eval `gpg-agent --daemon`.
# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
#
# (see end of this file).
# For anything else (that doesn't set env vars, or that needs a window manager),
# better use the Autostart folder.
When you manually use ssh-add, you might do this:
eval $(ssh-agent)
ssh-add

The ssh-add program uses environmental variables set for the session.
ssh-agent needs to be run before ssh-add.

Also look in /etc/X11/xdm/sys.xsession. Your system may source it even if xdm isn't used. It has options for ssh, gpg and even has notes about seahorse.

Code:
#
# If ssh is configured and ssh-agent is wanted set "yes"
#
usessh=yes

#
# If gpg is configured and gpg-agent is wanted set "yes"
#
usegpg=yes
Your mileage may vary of course. Startup and configuration scripts vary by distribution. It would be a good idea to grep for the terms "ssh", "ssh-agent", "ssh-add" and "seahorse" for files in /etc/, and running pstree to get a picture on how processes are started when you log in.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Invalid module format" after recompiling kernel without changing .config - why? kovlensky Linux - Kernel 5 09-10-2008 01:42 PM
booting fedora "invalid compressed format (err=1)" tjcarol Linux - Desktop 1 11-01-2007 04:52 AM
Cisco VPN Client on FC6 2.6.20 "invalid module format" rrautens Fedora 16 06-07-2007 10:21 PM
Realtek 8180 ,Debian, "Invalid module format" medo Linux - Wireless Networking 0 05-25-2005 08:08 AM
"Invalid module format" after FULL kernel recompile RedDwarf Linux - General 6 08-07-2004 08:46 PM


All times are GMT -5. The time now is 09:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration