Skip to content

security: disable password auth for root and ubuntu#2161

Merged
lowjoel merged 2 commits into
developfrom
lowjoel/remove-user-passwords-before-ami
May 22, 2026
Merged

security: disable password auth for root and ubuntu#2161
lowjoel merged 2 commits into
developfrom
lowjoel/remove-user-passwords-before-ami

Conversation

@lowjoel
Copy link
Copy Markdown
Contributor

@lowjoel lowjoel commented May 21, 2026

What kind of change does this PR introduce?

Fixes KUBEINT-203.

This prevents the users from being logged into except by SSH public key
authentication.

It also explicitly disables password/challenge response auth for SSH.

What is the current behavior?

The passwords used in user-data-cloudimg are persisted in every qemu image.

SSHd configuration has the default (i.e. challenge response and password auth disabled)

What is the new behavior?

The passwords are now set to '*'. We also uncomment/explicitly disable challenge response and SSH password auth.

$ cat /etc/shadow
root:*:20594:0:99999:7:::
daemon:*:20558:0:99999:7:::
bin:*:20558:0:99999:7:::
sys:*:20558:0:99999:7:::
sync:*:20558:0:99999:7:::
games:*:20558:0:99999:7:::
man:*:20558:0:99999:7:::
lp:*:20558:0:99999:7:::
mail:*:20558:0:99999:7:::
news:*:20558:0:99999:7:::
uucp:*:20558:0:99999:7:::
proxy:*:20558:0:99999:7:::
www-data:*:20558:0:99999:7:::
backup:*:20558:0:99999:7:::
list:*:20558:0:99999:7:::
irc:*:20558:0:99999:7:::
_apt:*:20558:0:99999:7:::
nobody:*:20558:0:99999:7:::
systemd-network:!*:20558::::::
systemd-timesync:!*:20558::::::
dhcpcd:!:20558::::::
messagebus:!:20558::::::
systemd-resolve:!*:20558::::::
sshd:!:20558::::::
pollinate:!:20558::::::
ubuntu:!*:20594:0:99999:7:::
_rpc:!:20594::::::
$ grep -i password /etc/ssh/sshd_config
#PermitRootLogin prohibit-password
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# PasswordAuthentication.  Depending on your PAM configuration,
# the setting of "PermitRootLogin prohibit-password".
# PAM authentication, then enable this but set PasswordAuthentication

Additional context

This prevents the users from being logged into except by SSH public key
authentication.
@lowjoel lowjoel force-pushed the lowjoel/remove-user-passwords-before-ami branch from 2d7bdf9 to 7ec9857 Compare May 21, 2026 04:01
@lowjoel lowjoel force-pushed the lowjoel/remove-user-passwords-before-ami branch from 7ec9857 to 2ab30c5 Compare May 21, 2026 04:03
@lowjoel lowjoel changed the title security: remove passwords for root and ubuntu security: disable password auth for root and ubuntu May 21, 2026
@lowjoel lowjoel marked this pull request as ready for review May 21, 2026 05:43
@lowjoel lowjoel requested review from a team as code owners May 21, 2026 05:43
Comment thread ansible/vars.yml Outdated
@lowjoel lowjoel force-pushed the lowjoel/remove-user-passwords-before-ami branch from 3f44354 to 2ab30c5 Compare May 21, 2026 05:47
@lowjoel lowjoel enabled auto-merge May 22, 2026 00:24
@lowjoel lowjoel added this pull request to the merge queue May 22, 2026
Merged via the queue into develop with commit 74aba22 May 22, 2026
2299 of 2563 checks passed
@lowjoel lowjoel deleted the lowjoel/remove-user-passwords-before-ami branch May 22, 2026 02:49
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.

3 participants