Skip to content

Enable PermitRootLogin for RHCOS in testcloud #3619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025

Conversation

coiby
Copy link
Contributor

@coiby coiby commented Mar 24, 2025

Currently, tmt fails to provision RHCOS because RHCOS e.g. RHCOS-4.17.2
don't have "PermitRootLogin no" in /etc/ssh/sshd_config but disable
PermitRootLogin 40-rhcos-defaults.conf. As a result, tmt can't connect
to the guest machine.

Follow [1] to permit root to login by SSH pubkey.

Note FCOS e.g. fedora-coreos-41.20250130.3.0 doesn't have
"PermitRootLogin no" so it actually permits root to have ssh login. So
ssh_root_login.service is unneeded.

[1] https://docs.fedoraproject.org/en-US/fedora-coreos/authentication/#_enabling_ssh_password_authentication

@coiby coiby requested a review from frantisekz as a code owner March 24, 2025 08:23
@coiby coiby force-pushed the coreos_ssh_root_login branch from c983ba5 to bc0ca88 Compare March 24, 2025 08:34
@coiby coiby changed the title testcloud: enable PermitRootLogin for CoreOS testcloud: enable PermitRootLogin for RHCOS Mar 24, 2025
@happz happz added the plugin | testcloud The testcloud virtual provision plugin label Mar 24, 2025
@happz happz added this to planning Apr 3, 2025
@github-project-automation github-project-automation bot moved this to backlog in planning Apr 3, 2025
@happz happz moved this from backlog to review in planning Apr 3, 2025
@psss psss added this to the 1.47 milestone Apr 10, 2025
@thrix thrix requested review from happz, thrix, psss and therazix April 16, 2025 21:28
Copy link
Collaborator

@thrix thrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested both, Fedora CoreOS and RHCOS and I was able to boot and login successfully.

root@ibm-p8-kvm-03-guest-02:/var/home/thrix/.local/share/tmt/run-250/default/plan/tree[root@ibm-p8-kvm-03-guest-02 tree]# cat /etc/os-release 
NAME="Red Hat Enterprise Linux CoreOS"

@happz happz added the status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish. label Apr 22, 2025
@happz happz moved this from review to merge in planning Apr 22, 2025
@psss psss changed the title testcloud: enable PermitRootLogin for RHCOS Enable PermitRootLogin for RHCOS in testcloud Apr 23, 2025
@psss psss added step | provision Stuff related to the provision step ci | full test Pull request is ready for the full test execution labels Apr 23, 2025
@thrix thrix modified the milestones: 1.47, 1.48 Apr 23, 2025
Currently, tmt fails to provision RHCOS because RHCOS e.g. RHCOS-4.17.2
don't have "PermitRootLogin no" in /etc/ssh/sshd_config but disable
PermitRootLogin 40-rhcos-defaults.conf. As a result, tmt can't connect
to the guest machine.

Follow [1] to permit root to login by SSH pubkey.

Note FCOS e.g. fedora-coreos-41.20250130.3.0 doesn't have
"PermitRootLogin no" so it actually permits root to have ssh login. So
ssh_root_login.service is unneeded.

[1] https://docs.fedoraproject.org/en-US/fedora-coreos/authentication/#_enabling_ssh_password_authentication

Signed-off-by: Coiby Xu <[email protected]>
@happz happz force-pushed the coreos_ssh_root_login branch from bc0ca88 to 2dd18a3 Compare April 26, 2025 13:51
@happz happz requested a review from lbrabec as a code owner April 26, 2025 13:51
@happz happz enabled auto-merge (squash) April 26, 2025 13:52
@happz
Copy link
Collaborator

happz commented Apr 26, 2025

/packit build

@happz happz merged commit 9ba3c0b into teemtee:main Apr 26, 2025
21 of 22 checks passed
@github-project-automation github-project-automation bot moved this from merge to done in planning Apr 26, 2025
@happz
Copy link
Collaborator

happz commented Apr 26, 2025

Chm, automerge does not wait for required chcecks when author cannot run them :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci | full test Pull request is ready for the full test execution plugin | testcloud The testcloud virtual provision plugin status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish. step | provision Stuff related to the provision step
Projects
Status: done
Development

Successfully merging this pull request may close these issues.

6 participants