Bug 555646 - OpenSSH ignores keys in ~/.ssh/config and offers keys from Seahorse instead
Summary: OpenSSH ignores keys in ~/.ssh/config and offers keys from Seahorse instead
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: openssh
Version: 12
Hardware: i686
OS: Linux
low
high
Target Milestone: ---
Assignee: Jan F. Chadima
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 641684 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-15 04:29 UTC by Phillip Smith
Modified: 2010-12-04 00:23 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-04 00:23:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Phillip Smith 2010-01-15 04:29:35 UTC
Description of problem:
I have 4 SSH keys for various purposes. Seahorse is aware of all of them, however SSH ignores the "IdentityFile" config in ~/.ssh/config and instead uses the keys from Seahorse in alphabetical order. This means I can not login to servers where the MaxAuthAttempts is set to 3 as my 3 attempts expire before getting to the 4th key (which is the one that will let me login).

Version-Release number of selected component (if applicable):
Fedora 12
OpenSSH_5.2p1
OpenSSL 0.9.8l

How reproducible:
Always

Steps to Reproduce:
1. Create 4 SSH keys and add to Seahorse
2. Configure ~/.ssh/config with server details, including an IdentityFile directive
3. Set server to only allow 3 auth attempts
4. Try to login with '-v' flag to ssh. You will see all keys offered in alphabetical order.
  
Actual results:
Can not login to server because key is not chosen from config file and it pulled from Seahorse instead.

Expected results:
IdentityFile directive from ~/.ssh/config is chosen first, then any IdentifyFile directives in /etc/ssh/ssh_config and only then is Seahorse asked for further keys.

Additional info:
~/.ssh/config
=========================================================
Host *
	ControlMaster auto
	ControlPath ~/.ssh/master-%r@%h:%p
	VerifyHostKeyDNS yes

<SNIP OTHER HOSTS>

Host dingo dingo.DOMAIN.nl
	hostname dingo.DOMAIN.nl
	port 5801
	user fukawi2
	IdentityFile ~/.ssh/privatekey_personal.dsa
	DynamicForward localhost:3128
=========================================================

Output from SSH with debug turned on. You can see other keys being offered (marked with a *) before the one configured in IdentityFile above.
=========================================================
phillips@phil-desktop ~  $ ssh dingo -v
OpenSSH_5.2p1, OpenSSL 1.0.0-fips-beta4 10 Nov 2009
debug1: Reading configuration data /home/phillips/.ssh/config
debug1: Applying options for *
debug1: Applying options for dingo
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: auto-mux: Trying existing master
debug1: Control socket "/home/phillips/.ssh/master-fukawi2.nl:5801" does not exist
debug1: Connecting to dingo.DOMAIN.nl [74.207.xxx.xx] port 5801.
debug1: Connection established.
debug1: identity file /home/phillips/.ssh/privatekey_personal.dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2
debug1: match: OpenSSH_5.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: found 2 insecure fingerprints in DNS
debug1: matching host key fingerprint found in DNS
debug1: Host '[dingo.DOMAIN.nl]:5801' is known and matches the RSA host key.
debug1: Found key in /home/phillips/.ssh/known_hosts:108
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
* debug1: Offering public key: fukawi2-archserver
debug1: Authentications that can continue: publickey,password
* debug1: Offering public key: .ssh/privatekey_nwb.dsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/phillips/.ssh/privatekey_personal.dsa
=========================================================

Comment 1 Fabian A. Scherschel 2010-05-18 08:03:27 UTC
I think I ran into this bug or something similar when trying to push to Gitorious. I only have one SSH key which used to work but suddenly git reported the following on a push:

Agent admitted failure to sign using the key. Permission denied (publickey).

Regenerating the key and doing a "ssh-add ~/.ssh/id_rsa" fixed the problem. I think this is related to the follwing gnome-keyring / ssh-agent bug described in Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/201786

Comment 2 Phillip Smith 2010-05-18 09:17:55 UTC
I think that's a different problem. I do not see the error "Agent admitted failure to sign using the key".

Then again, it *could* be the same problem manifesting differently.

Comment 3 Fabian A. Scherschel 2010-05-18 09:32:00 UTC
I was assuming this since Seahorse is involved. I am by no means an expert in all things SSH. I will file a separate bug if that is wanted.

Comment 4 Phillip Smith 2010-05-18 09:43:09 UTC
*shrugs* I'm not sure either -- I'm just saying that I don't get that exact error message.... Someone more knowledgeable than both of us in this area can determine hopefully ;)

Comment 5 Michael Spahn 2010-10-10 18:07:52 UTC
*** Bug 641684 has been marked as a duplicate of this bug. ***

Comment 6 Bug Zapper 2010-11-04 00:56:32 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Fabian A. Scherschel 2010-11-05 08:19:54 UTC
Are we sure this is fixed in F14? I haven't had any problems so far but I haven't done much uploading to Gitorious lately (which is where this error would mostly surface for me).

Comment 8 Jan F. Chadima 2010-11-08 12:45:14 UTC
Did you test to use IdentitiesOnly ssh command? Maybe in some Host.... section?

Comment 9 Fabian A. Scherschel 2010-11-08 13:02:59 UTC
How would I go about doing that?

Comment 10 Jan F. Chadima 2010-11-20 12:27:19 UTC
man ssh_config

Comment 11 Bug Zapper 2010-12-04 00:23:22 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.