Bug 1856758 - foreman-proxy ssh key is copied 3 times to the provisioned machine in /root/.ssh/authorized_keys
Summary: foreman-proxy ssh key is copied 3 times to the provisioned machine in /root/....
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning Templates
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.9.0
Assignee: Adam Ruzicka
QA Contact: Roman Plevka
URL:
Whiteboard:
: 1898589 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-14 11:57 UTC by Ahmed Eladawy
Modified: 2023-12-15 18:27 UTC (History)
9 users (show)

Fixed In Version: tfm-rubygem-foreman_remote_execution-4.2.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-21 13:15:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30762 0 Normal Closed foreman-proxy ssh key is copied 3 times to the provisioned machine in /root/.ssh/authorized_keys 2021-02-11 08:43:19 UTC
Red Hat Knowledge Base (Solution) 5468141 0 None None None 2020-10-06 18:15:09 UTC
Red Hat Product Errata RHSA-2021:1313 0 None None None 2021-04-21 13:17:10 UTC

Description Ahmed Eladawy 2020-07-14 11:57:03 UTC
Description of problem:

The foreman-proxy is copied 3 times on the provisioned machine in /root/.ssh/authorized_keys when the remote execution is available.

By previewing the remote_execution_ssh_keys snippet , it shows the foreman-proxy keys of the satellite and the capsule 3 times

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

Red Hat satellite 6.7

How reproducible:

100%

Steps to Reproduce:
1. Provision a new machine.
2. Check file /root/.ssh/authorized_keys
3. Also by previewing remote_execution_ssh_keys snippet.

Actual results:

The ssh key is replicated 3 times

Expected results:

The ssh key has only one entry for the satellite and one for the capsule if existing.

Comment 4 Bryan Kearney 2020-09-08 08:03:12 UTC
Upstream bug assigned to aruzicka

Comment 5 Bryan Kearney 2020-09-08 08:03:14 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30762 has been resolved.

Comment 8 Brad Buckingham 2020-11-20 13:48:50 UTC
*** Bug 1898589 has been marked as a duplicate of this bug. ***

Comment 9 Roman Plevka 2021-02-24 12:05:50 UTC
VERIFIED
on sat6.9.0-14.0

the snippet now works correctly and the provisioned host ends up with a single occurrence of the key in authorized_keys file of root user:

```
[root@abel-frames ~]# cat ~/.ssh/authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCes4pAjGQ62TWSC2E6k0YcxCPV1nWKOfNjBtcVuOIqnC/kQ4Nh3JxAcRbaj9/zn4zWYXyYO4bS9AtvAweHf1C1fuzUopr73Rs822GlaktlA6UdwyGEv9gO2+INvNEyG167kAIa9qxygbqfiDnpjBCTdDE4iIlEkAvIdDv4sFEUOi4zmV5aBTRh0S3/UbtqH5Yescp2mRzpbz7AA4dEpjDu5mnVZXtsv8omhvukPgf9UNol6v4fMPHlPNvL8zZ8CXe51JAWcFzVS2rwKqt6R7nwhb6XEuVkNFNc8VgF52njoFQVUOia/XYcjzJmZI7kib2omcVfTxwIM/zgA38rjtdb foreman-proxy@<redacted>.com
[root@abel-frames ~]#
```

Comment 12 errata-xmlrpc 2021-04-21 13:15:01 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 (Moderate: Satellite 6.9 Release), 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/RHSA-2021:1313


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