Skip to content

Comments

fdi.ssh=1 enables root login & passwd auth#178

Merged
stejskalleos merged 1 commit intomasterfrom
ls/ssh1
Feb 5, 2026
Merged

fdi.ssh=1 enables root login & passwd auth#178
stejskalleos merged 1 commit intomasterfrom
ls/ssh1

Conversation

@stejskalleos
Copy link
Contributor

@stejskalleos stejskalleos commented Feb 4, 2026

Before:
Adding fdi.ssh=1 fdi.rootpw=changeme to kernel attributes will enable the sshd service, but it won't allow root login to authenticate.

Now
Adding fdi.ssh=1 will enable root login and password authentication for the root user.

Notes:
fdi.ssh=true doesn't work; the documentation is incorrect. See theforeman/foreman-documentation#4635


{
echo '#FDI'
echo "PubkeyAuthentication yes"
Copy link
Member

Choose a reason for hiding this comment

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

How do I deploy a key into FDI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

TIL. Thanks

@evgeni
Copy link
Member

evgeni commented Feb 5, 2026

Given both PubkeyAuthentication and PasswordAuthentication is yes by default, and there is no point in deleting comments, this could be:

sed -i '/^PermitRootLogin/d' /etc/ssh/sshd_config
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config

But I am fine if you want to explicitly set the others.

@stejskalleos
Copy link
Contributor Author

But I am fine if you want to explicitly set the others.

I'd like to explicitly do that, it's clear what we do (and what we need) without looking for the default sshd_config file

KEYS=("PubkeyAuthentication" "PasswordAuthentication" "PermitRootLogin")

for KEY in "${KEYS[@]}"; do
sed -i "/^#\?${KEY}/d" "/etc/ssh/sshd_config"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sed -i "/^#\?${KEY}/d" "/etc/ssh/sshd_config"
sed -i "/^${KEY}/d" "/etc/ssh/sshd_config"

We don't need to delete comments.

@stejskalleos stejskalleos merged commit 8371934 into master Feb 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants