Skip to content

Add guide for disabling SSH password login - #932

Open
hanran-y wants to merge 1 commit into
mainfrom
docs/disable-ssh-password-login
Open

Add guide for disabling SSH password login#932
hanran-y wants to merge 1 commit into
mainfrom
docs/disable-ssh-password-login

Conversation

@hanran-y

Copy link
Copy Markdown
Contributor

Summary

New host guide for switching a machine to SSH key only login on Ubuntu Server 22.04 and 24.04.

  • Adds host/disable-ssh-password-login.mdx
  • Adds it to the Host > Guides > Troubleshooting nav group
  • Links to it from host/verification-stages.mdx

Six steps, each one explanation, then the command, then the output to expect. The order matters: the reader proves key login works from a second terminal before turning passwords off, so a broken key cannot lock them out. A recovery section at the end covers getting back in over IPMI, iDRAC, iLO, or a directly attached monitor and keyboard.

Two things it deliberately covers, because both are easy to miss:

  • A stock Ubuntu install accepts passwords. The setting ships commented out and sshd turns password login on when it is absent, so the config file looks clean while passwords are enabled.
  • A file under /etc/ssh/sshd_config.d/ overrides the main config. sshd_config starts with Include /etc/ssh/sshd_config.d/*.conf and OpenSSH keeps the first value it finds, so editing sshd_config alone can have no effect. Documented in the Ubuntu Server OpenSSH guide.

Notes on the commands

  • The key proof uses ssh -o PreferredAuthentications=publickey, not -o PasswordAuthentication=no. The latter leaves kbdinteractiveauthentication yes on the client, so sshd can still prompt for a password and the check would pass without the key being used.
  • sudo sshd -t runs before every restart, so a bad config cannot take sshd down.
  • systemctl restart ssh.service is correct on both releases. Ubuntu 24.04 socket activates sshd and 22.04 does not, but that does not change this command.

Test plan

  • Renders on the Mintlify dev server
  • Appears under Host > Guides > Troubleshooting
  • docs.json parses
  • ssh-keygen and ssh-copy-id output blocks taken from real output, not paraphrased
  • PreferredAuthentications=publickey verified against the ssh client with ssh -G

New host page covering how to switch a machine to SSH key only login on
Ubuntu Server 22.04 and 24.04, with the steps ordered so the reader proves
their key works before turning passwords off.

Covers two things that commonly trip people up: a stock Ubuntu install has
password login on because the setting ships commented out and sshd defaults
to yes, and a drop in under /etc/ssh/sshd_config.d/ overrides the main
config file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
vastai-80aa3a82 🟢 Ready View Preview Aug 29, 2026, 12:43 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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