Skip to content

docs: also update cloud-init sshd drop-in when disabling SSH password auth#34

Open
veto9292 wants to merge 1 commit into
hiddify:mainfrom
veto9292:docs/ssh-disable-password-cloud-init-override
Open

docs: also update cloud-init sshd drop-in when disabling SSH password auth#34
veto9292 wants to merge 1 commit into
hiddify:mainfrom
veto9292:docs/ssh-disable-password-cloud-init-override

Conversation

@veto9292

@veto9292 veto9292 commented Jul 7, 2026

Copy link
Copy Markdown

Problem

The guide Disable SSH Password Authentication (docs/manager/basic-concepts-and-troubleshooting/Disable-SSH-Password-Authentication) tells users to set PasswordAuthentication no in /etc/ssh/sshd_config and restart SSH.

On most modern cloud images this is not enough. Ubuntu/Debian ship /etc/ssh/sshd_config with an include directive near the top:

Include /etc/ssh/sshd_config.d/*.conf

and many cloud providers (Azure, AWS, Oracle Cloud, Hetzner, Vultr, …) provision a drop-in file /etc/ssh/sshd_config.d/50-cloud-init.conf that contains PasswordAuthentication yes. Because sshd uses the first value it finds for each option and the include sits at the top, that drop-in overrides the value set later in the main file.

The result: after following the guide exactly and restarting SSH, password login still works. I reproduced this on a fresh server.

Fix

Add a step to Step 2 (in both the English and Persian versions) instructing users to also check /etc/ssh/sshd_config.d/50-cloud-init.conf and, if it exists, set PasswordAuthentication no there as well.

Files changed

  • docs/manager/basic-concepts-and-troubleshooting/Disable-SSH-Password-Authentication.md (English)
  • docs/manager/basic-concepts-and-troubleshooting/Disable-SSH-Password-Authentication.fa.md (Persian)

Documentation only — no other files touched.

🤖 Generated with Claude Code

…rd auth

Many cloud images (Ubuntu on Azure, AWS, Oracle Cloud, Hetzner, Vultr,
etc.) ship /etc/ssh/sshd_config.d/50-cloud-init.conf containing
`PasswordAuthentication yes`. Because sshd_config includes
/etc/ssh/sshd_config.d/*.conf near its top and sshd uses the first
value it finds for each option, that drop-in overrides the
`PasswordAuthentication no` set in the main file. As a result, password
login keeps working even after following the current guide.

Add a step (English + Persian) instructing users to also check
/etc/ssh/sshd_config.d/50-cloud-init.conf and set
`PasswordAuthentication no` there when it exists.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant