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).
Created from redmine issue http://projects.theforeman.org/issues/15214
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
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:
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.
Created attachment 1272727 [details] verification screenshot 1
Created attachment 1272728 [details] verification screenshot 2
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