Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1426709

Summary: [RFE] Alternate port for SSH for certain hosts
Product: Red Hat Satellite Reporter: Satellite Program <pm-sat>
Component: Remote ExecutionAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.9CC: bkearney, inecas, jcallaha, zhunting
Target Milestone: UnspecifiedKeywords: FutureFeature
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_openscap-0.5.3.19-1, smart_proxy_remote_execution_ssh_core-0.1.2.6-1, smart_proxy_remote_execution_ssh-0.1.2.6-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-01 14:00:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
verification screenshot 1
none
verification screenshot 2 none

Description Satellite Program 2017-02-24 16:19:02 UTC
Would be great if there was a way to specify a custom port for certain hosts when using remote execution over SSH (like: ssh -p 22222 user@host).

Comment 1 Satellite Program 2017-02-24 16:19:06 UTC
Created from redmine issue http://projects.theforeman.org/issues/15214

Comment 2 Ivan Necas 2017-03-03 09:05:19 UTC
Steps to verify:

Scenario 1 - change ssh port on per-host basis:

1. configure some host to listen for ssh on different port
2. set remote_execution_ssh_port on host params to the port that corresponds to the port
3. run the job on the host
4. expected results: different port of the particular host was used (for other hosts, 22 port was still used)

Scenario 2 - change the default ssh port:

1. configure some host to listen for ssh on different port
2. set remote_execution_ssh_port in Settings -> RemoteExecution to differnt port (this changes the default port to be used)
3. run the job on the host
4. expected results: the different port was used on all the hosts in the job invocation

Comment 3 jcallaha 2017-04-06 20:50:46 UTC
Failed QA in Satellite 6.2.9 Snap 2.

Job execution still points to port 22. I not only set the ssh port for the host, but also system-wide. However, the error below is still seen regardless of my configuration.

 1: Error initializing command #
 2: Errno::EHOSTUNREACH No route to host - connect(2) for "172.17.0.29" port 22
 3: Exit status: EXCEPTION


-bash-4.2# hammer -u admin -p changeme host update --parameters "remote_execution_ssh_port=5522" --id 2
Host updated

-bash-4.2# hammer -u admin -p changeme host info --id 2
Id:                 2
Name:               re-test1
Organization:       Default Organization
Location:           Default Location
Puppet CA Id:       
Puppet Master Id:   
Cert name:          re-test1
Managed:            no
Installed at:       
Last report:        
Network:            
    IP:  172.17.0.29
    MAC: 02:42:ac:11:00:1d
Network interfaces: 
 1) Id:          7
    Identifier:  eth0
    Type:        interface (primary, provision)
    MAC address: 02:42:ac:11:00:1d
    IP address:  172.17.0.29
    FQDN:
Operating system:   
    Architecture:           x86_64
    Operating System:       RedHat 7.2
    Build:                  no
    Custom partition table:
Parameters:         
    remote_execution_ssh_port => 5522
Additional info:    
    Owner Id:   3
    Owner Type: User
    Enabled:    yes
    Comment:

Comment 6 jcallaha 2017-04-19 20:13:25 UTC
Verified in satellite 6.2.9 Snap 3

Changed ssh port on host to 5522, then updated it using hammer (see comment #3). 

Running Remote Execution commands against the host now successfully target port 5522 when set at the host as well as when set at system level.

Comment 7 jcallaha 2017-04-19 20:14:11 UTC
Created attachment 1272727 [details]
verification screenshot 1

Comment 8 jcallaha 2017-04-19 20:15:06 UTC
Created attachment 1272728 [details]
verification screenshot 2

Comment 10 errata-xmlrpc 2017-05-01 14:00:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1191