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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions tmt/steps/provision/testcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,16 @@ def import_testcloud(logger: tmt.log.Logger) -> None:
- name: ${user_name}
ssh_authorized_keys:
- ${public_key}
systemd:
units:
- name: ssh_root_login.service
enabled: true
contents: |
[Unit]
Before=sshd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/sed -i \
"s|^PermitRootLogin no$|PermitRootLogin yes|g" \
/etc/ssh/sshd_config
[Install]
WantedBy=multi-user.target
storage:
files:
- path: /etc/ssh/sshd_config.d/20-enable-root-login.conf
mode: 0644
contents:
inline: |
# CoreOS disables root SSH login by default.
# Enable it.
# This file must sort before 40-rhcos-defaults.conf.
PermitRootLogin yes
"""

# VM defaults
Expand Down