Bug 1033592

Summary: Splice-export command syntax
Product: Red Hat Satellite 5 Reporter: James Genus Jr. <jgenus>
Component: Docs Installation GuideAssignee: Megan Lewis <melewis>
Status: CLOSED CURRENTRELEASE QA Contact: Dan Macpherson <dmacpher>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 560CC: cperry, gborsuk, melewis, mtaru, perobins, rjerrido, vvasilev
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-07 23:58:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1018166    

Description James Genus Jr. 2013-11-22 12:53:38 UTC
Description of problem:

Incorrect splice-export command in Section 4.4.3. Configuring Servers for Enhanced Entitlements Reporting

Version-Release number of selected component (if applicable):
Satellite 5.6


How reproducible:

Always


Steps to Reproduce:
1. [root@sam13] # su - splice -s /bin/bash
2. [splice@sam13] # ssh -i /var/lib/splice/id_rsa-sat swreport@sat56-hostname splice-export
3.

Actual results:

[splice@sam13] # ssh -i /var/lib/splice/id_rsa-sat swreport@sat56-hostname splice-export splice-export
bash: splice-export: command not found


Expected results:
Output from spacewalk-report splice-export

Additional info:

Correct command syntax below
1. [root@sam13] # su - splice -s /bin/bash
2. [splice@sam13] # ssh -i /var/lib/splice/id_rsa-sat swreport@sat56-hostname spacewalk-report splice-export

Comment 1 James Genus Jr. 2013-11-22 12:56:05 UTC
Actual results should read:

[splice@sam13] # ssh -i /var/lib/splice/id_rsa-sat swreport@sat56-hostname splice-export
bash: splice-export: command not found

Comment 2 Dan Macpherson 2014-01-21 15:19:48 UTC
This bug can be worked on early during the planning stages for Satellite 5.7.

Comment 4 Rich Jerrido 2014-01-29 17:33:02 UTC
This bug can be reproduced if 

'command="/usr/bin/spacewalk-report $SSH_ORIGINAL_COMMAND" ' 

isn't prepending the SSH key in the swreport user's authorized_keys file on the same line or has additional characters between it and the ssh key.  When this happens, SSH ignores it, and the $SSH_ORGINAL_COMMAND varible isn't properly passed via the SSH connection. 

It would be prudent to check the authorized_keys files to make sure it is syntactically correct.  run 'cat -vet' against it to make sure there aren't any newlines or unwanted characters between the command directive and the ssh key itself. Additionally, it wouldn't be a bad idea to update Step 6 of Procedure 4.2. To Configure Servers for Enhanced Entitlements Reporting to reflect this. 

Suggestion would be:
"Prepend the SAM public key content in /home/swreport/.ssh/authorized_keys with the following, ensuring that the prepended text is on the same line as the SSH public key:

command="/usr/bin/spacewalk-report $SSH_ORIGINAL_COMMAND"

This ensures the swreport user only uses the spacewalk-report command."