Bug 841066 - "rhc domain status" should not show "Your public key is not loaded into a running ssh-agent" when local and remote public key dismatch
"rhc domain status" should not show "Your public key is not loaded into a run...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Clayton Coleman
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-17 22:53 EDT by jizhao
Modified: 2015-05-14 22:00 EDT (History)
4 users (show)

See Also:
Fixed In Version: fork_ami_US2597_US2599_US2813_US2817_US2872_US2816_US2814_209
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-06 13:48:51 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jizhao 2012-07-17 22:53:55 EDT
Description of problem:
Create domain, remove the ssh keys and generate a new pair. Load the new keys into ssh-agent and run "rhc domain status". It says "Your public key is not loaded into a running ssh-agent". The error information is incorrect.

Version-Release number of selected component (if applicable):
rhc-0.96.2-1.el6_3.noarch


How reproducible:
Always

Steps to Reproduce:
1.Create domain
2.Remove the ssh keys and generate a new pair.
$ rm ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
$ ssh-keygen -t rsa -f ~/.ssh/id_rsa
3.Run ssh-agent and load the new keys in it
$ eval `ssh-agent`
$ ssh-add ~/.ssh/id_rsa
4.Run "rhc domain status".
  
Actual results:
<------------output------------->
F
===============================================================================
Failure:
test_03_remote_ssh_keys(Test3_SSH) [/usr/lib/ruby/gems/1.8/gems/rhc-0.96.2/bin/rhc-chk:400]:
Your public key is not loaded into a running ssh-agent 
If this is your only error, your connection may still work, depending on your SSH configuration.
<false> is not true.
===============================================================================
.

Finished in 14.603237 seconds.

7 tests, 9 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
85.7143% passed
<------------------------------>

Expected results:
The error message should be something like "~/.ssh/id_rsa.pub didn't match your remote pub key"

Additional info:
After updating sshkey, "rhc domain status" behaves correctly:
$ rhc sshkey update -i default -k ~/.ssh/id_rsa.pub
Comment 1 John (J5) Palmieri 2012-10-09 13:43:19 EDT
We don't check sshkeys during domain status in the rewrite.
Comment 2 jizhao 2012-10-10 00:54:48 EDT
Verify this bug according to comment 1.
Comment 3 jizhao 2012-10-10 01:05:41 EDT
(In reply to comment #2)
> Verify this bug according to comment 1.

Verify this bug on devenv_2304

Version/Release:
devenv_2304
rhc-0.99.5

Steps to verify:
1.Create domain
2.Remove the ssh keys and generate a new pair.
$ rm ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
$ ssh-keygen -t rsa -f ~/.ssh/id_rsa
3.Run ssh-agent and load the new keys in it
$ eval `ssh-agent`
$ ssh-add ~/.ssh/id_rsa
4.Run "rhc domain status".

Actual results:
<------------------------output---------------------------->
Loaded suite /usr/bin/rhc-chk
Started
.....F
===============================================================================
Failure:
  Your public key is not loaded into a running ssh-agent 
  If this is your only error, your connection may still work, depending on your SSH configuration.
  <false> is not true.
test_03_remote_ssh_keys(Test3_SSH)
/usr/lib/ruby/gems/1.8/gems/rhc-0.99.5/bin/rhc-chk:400:in `test_03_remote_ssh_keys'
     397:     require_remote_keys("whether your local SSH keys match the ones in your account")
     398:     require_agent_keys(false)
     399: 
  => 400:     assert !(@@remote_pub_keys & [agent_key_fingerprints,libra_public_key].flatten).empty? ,error_for(:pubkey_not_loaded," ")
     401:   end
     402: 
     403:   def test_04_ssh_connect
===============================================================================
.

Finished in 6.605408 seconds.

7 tests, 9 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
85.7143% passed

1.06 tests/s, 1.36 assertions/s
<---------------------------------------------------->

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