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 2083269 - Allow enabling root access via ssh with password for kickstart installations - pykickstart part
Summary: Allow enabling root access via ssh with password for kickstart installations ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: pykickstart
Version: 9.0
Hardware: All
OS: Linux
medium
unspecified
Target Milestone: rc
: ---
Assignee: Brian Lane
QA Contact: Release Test Team
Sagar Dubewar
URL:
Whiteboard:
Depends On:
Blocks: 2033849
TreeView+ depends on / blocked
 
Reported: 2022-05-09 15:03 UTC by Jan Stodola
Modified: 2022-11-15 11:28 UTC (History)
8 users (show)

Fixed In Version: pykickstart-3.32.7-1.el9
Doc Type: Enhancement
Doc Text:
.Added the `--allow-ssh` kickstart option to enable password-based SSH root logins During the graphical installation, you have an option to enable password-based SSH root logins. This functionality was not available in kickstart installations. With this update, an option `--allow-ssh` has been added to the `rootpw` kickstart command. This option enables the root user to login to the system using SSH with a password.
Clone Of: 2033849
Environment:
Last Closed: 2022-11-15 10:26:32 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-121458 0 None None None 2022-05-09 15:25:48 UTC
Red Hat Issue Tracker RTT-4583 0 None None None 2022-05-25 10:45:43 UTC
Red Hat Issue Tracker RTT-4584 0 None None None 2022-05-25 10:45:49 UTC
Red Hat Product Errata RHBA-2022:8138 0 None None None 2022-11-15 10:26:36 UTC

Description Jan Stodola 2022-05-09 15:03:31 UTC
There needs to be a way to specify that root login via ssh can be allowed when running a kickstart installation.
anaconda part of this feature is tracked in bug 2033849.


+++ This bug was initially created as a clone of Bug #2033849 +++

Description of problem:

When we do a RHEL 9 install, we need to allow root for ssh based logins by
marking the checkbox. This thing is not recorded to the kickstart generated
for the installation and further it blocks the root account if the kickstart
is used as reference kickstart.

The installation works fine with original install and root login works but
when the resultant kickstart is used for other install the root can't loging
with ssh.

This is common practice administrators follow to have a procedure recorded to
kickstart so will create impact on automated installations and post
installation things.


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

RHEL 9 Beta

How reproducible:

Everytime installing RHEL9 from kickstart recorded from a manual install.

Steps to Reproduce:
1. Install RHEL 9
2. In user section allow ssh based login for root
3. Copy the /root/anaconda-ks.cfg file for another install
4. The another install will not allow root login with ssh

Actual results:

Fails to record kickstart properly.

Expected results:

Shall record the option.

Additional info:

We don't see this to RHEL 8 so probably addition of this feature needs some
work in RHEL 9

--- Additional comment from Jan Stodola on 2022-01-14 15:26:16 CET ---

There is a workaround via %post script for kickstart installations:

%post
echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/01-permitrootlogin.conf
%end

--- Additional comment from Jan Stodola on 2022-01-17 16:41:26 CET ---

FYI, the workaround has been also added to the official documentation:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9-beta/html-single/9.0_release_notes/index#BZ-1940653
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9-beta/html-single/performing_an_advanced_rhel_installation/index#rootpw-required_kickstart-commands-for-system-configuration

--- Additional comment from Jiri Konecny on 2022-01-21 11:57:21 CET ---

Proposing to 9.1.0 planning.

Comment 1 Brian Lane 2022-05-09 17:03:29 UTC
Are you saying that when you use sshkey https://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#id57 to set a root ssh key (for the *installed* system's root) that they cannot login?

Or are you saying that it isn't included in the example kickstart that's generated?

Or something else :)

A couple example kickstarts would also be helpful.

Comment 2 Brian Lane 2022-05-09 17:12:14 UTC
Oops. I think I understand now, I missed the mention of 'password' somehow. My brain seems to assume all ssh access is via keys :)

So it looks like the problem is:
 * Anaconda has a GUI option to allow root password ssh logins
 * kickstart does not have a way to express that as part of 'rootpw'

So I think the solution here is to add a '--allow-ssh' option to the 'rootpw' command.

As always, this also needs to be added upstream first.

Comment 3 Brian Lane 2022-05-09 19:39:54 UTC
PR - https://github.com/pykickstart/pykickstart/pull/409

Comment 4 Jiri Konecny 2022-05-09 19:45:35 UTC
Thank you for creating the PR so quickly Brian.

Comment 7 Brian Lane 2022-05-31 21:29:43 UTC
rhel9-branch PR - https://github.com/pykickstart/pykickstart/pull/411 (had to replace F37 usage with RHEL9 and also tweaked the tests so they will run on py3.9 or py3.10 for easier local testing).

Comment 12 Brian Lane 2022-06-16 15:29:09 UTC
Adding https://github.com/pykickstart/pykickstart/pull/412

Comment 13 Jan Stodola 2022-06-20 15:43:49 UTC
Moving back to Verified:Tested, the patch from comment 12 is included in pykickstart-3.32.7-1.el9

Comment 17 Jan Stodola 2022-06-27 07:43:03 UTC
Checked that pykickstart-3.32.7-1.el9 is in nightly compose RHEL-9.1.0-20220627.0 and the prepared documentation looks good.

Moving to VERIFIED

Comment 19 errata-xmlrpc 2022-11-15 10:26:32 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 (pykickstart bug fix and enhancement update), 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-2022:8138


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