RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 2129275 - SSH lost after upgrading from RHEL 8 to 9 due unprotected private key files
Summary: SSH lost after upgrading from RHEL 8 to 9 due unprotected private key files
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: openssh
Version: 9.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Dmitry Belyavskiy
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-23 07:42 UTC by Luis Arizmendi
Modified: 2023-06-09 13:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-09 13:48:24 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CRYPTO-8479 0 None None None 2022-10-05 13:53:30 UTC
Red Hat Issue Tracker RHELPLAN-134767 0 None None None 2022-09-23 07:49:29 UTC

Description Luis Arizmendi 2022-09-23 07:42:34 UTC
Description of problem:
--------------------------------------------

I installed a RHEL 8.6 (RHEL for Edge) and I followed the procedure shown in [1] to perform the upgrade to RHEL 9.

The upgrade was ok, but probably due to the different hardening policies in RHEL 9, I was not able to connect to the server anymore using SSH. 

Connecting using the console I found this message:

"WARNING: UNPROTECTED PRIVATE KEY FILE!"

I checked that by changing permissions to the key files (chmod 600 /etc/ssh/*key) and restarting the sshd service I recovered the access.

The problem is that is not documented and losing SSH during an upgrade is something that shouldn't happen so either we document it, change that ssh policy in RHEL 9 to just warning (instead of enforcing, which probably is not a good idea), or make these changes in the permissions automatically during the upgrade process.

It happened with RHEL for Edge but probably it's something that will face in any RHEL 8 to 9 upgrade.


[1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/composing_installing_and_managing_rhel_for_edge_images/index#proc_upgrading-your-rhel-8-system-to-rhel-9_managing-rhel-for-edge-images


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

RHEL 8.6 -> RHEL 9


How reproducible:
----------------------------------------------------------------------

Reproducible


Steps to Reproduce:
----------------------------------------------------------------------

1. Deploy a RHEL for Edge 8.6 (maybe also just RHEL 8.6)
2. Perform the upgrade
3. Try to connect to the upgraded server using SSH


Actual results:
----------------------------------------------------------------------
It's not possible to connect to the upgraded server using SSH


Expected results:
----------------------------------------------------------------------
You should be able to access the server using SSH, even more when you didn't change any default configuration/permission in RHEL 8.6



Additional info:

Comment 1 Jakub Jelen 2022-09-23 17:00:58 UTC
What were the permissions of the hostkeys before the upgrade. What steps did you use to upgrade the server? I am not aware of anything during upgrade that should change the permissions of the ssh hostkeys and this check for the hostkeys permissions is in openssh for ages.


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