Repository navigation
presets/secure-node: turn off SSH password login for the sshd onion service - #273
Merged
prusnak merged 2 commits intoNov 18, 2026
Merged
Conversation
ostermayer
force-pushed
the
secure-node-ssh-no-password
branch
from
November 16, 2026 14:38
11dabea to
7943b31
Compare
viberaven
reviewed
Nov 16, 2026
viberaven
left a comment
Contributor
There was a problem hiding this comment.
Reviewed 7943b31b3ccb.
No actionable findings. Checked both SSH authentication defaults, explicit overrides, preset detection, and the migration notice against the account-lockout risk. The upgrade instructions cover password login, keyboard-interactive/PAM configurations, and equal-priority mkDefault conflicts. Local module-config and mdBook builds pass. CI is green; I did not rerun the SSH VM scenario locally.
Review performed with Codex (GPT-6 Astra).
Contributor
|
LGTM, just please focus v0.2.0. Changes requested: only to fit the notice contract on master (#283). The preset change and tests look good. Must fix (rebase onto master):
Should fix:
Assisted-by: Claude Code (Claude Opus 5.5) |
ostermayer
force-pushed
the
secure-node-ssh-no-password
branch
from
November 18, 2026 00:19
7943b31 to
cdd7cc9
Compare
…ervice The secure-node preset always publishes sshd as an onion service, but nothing in the modules turned off SSH password login. Only the example configs did. NixOS allows passwords by default, so a config that imports the preset into an existing setup let anyone with the onion address try passwords over Tor. This includes the operator, who is in the groups that control funds. The preset now sets PasswordAuthentication and KbdInteractiveAuthentication to false with mkDefault, so sshd accepts only keys and a config can still turn them back on. This can lock out an account that logs in with a password or with one-time codes through PAM, so a 0.2.0 notice reports it to every config with the preset and sshd. Fixes bitcoinix#132. Assisted-by: Claude Code (Claude Opus 5.5)
ostermayer
force-pushed
the
secure-node-ssh-no-password
branch
from
November 18, 2026 01:01
cdd7cc9 to
db3e418
Compare
prusnak
enabled auto-merge
November 18, 2026 10:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #132.
The
secure-node.nixpreset always publishes sshd as an onion service, but nothing inmodules/turned off SSH password login. Only the example configs did. NixOS allows passwords by default. So a config that imports the preset into an existing setup let anyone with the onion address try passwords over Tor. This includes the operator, who is in the groups that control funds (bitcoin,clightning,lnd).The preset now sets
services.openssh.settings.PasswordAuthenticationandKbdInteractiveAuthenticationtomkDefault false. sshd then accepts only keys, over the onion service and over the node's IP address. A config that needs passwords can still set either option totrue.This can lock out an account that logs in with a password, so it comes with a 0.2.0 notice. It fires for every config that uses the preset and enables sshd. A narrower condition would need to tell how the config defines the two options, and every way to do that missed some affected configs. A missed notice can lock the operator out of the node, and a needless one only costs a config version bump. The notice and the upgrade notes say that nothing changes for a config that already sets both options to
false, like the flakes and Colmena examples.Keyboard-interactive login through PAM depends on the PAM module, because NixOS sets
security.pam.services.sshd.unixAuthfromPasswordAuthentication. I checked sshd's PAM stack in the pinned nixpkgs:googleAuthenticator: withoutunixAuth, the stack is onlypam_deny, so such setups need both options set back totrue. Withservices.homed.enable, NixOS adds the rule withoutunixAuth.otpwAuth: withunixAuth, asufficient pam_unixrule comes beforepam_otpw, so a plain password would skip the one-time password. Such setups need onlyKbdInteractiveAuthentication = true.The upgrade notes say this and tell users to test a new login before they close their session.
A config that sets one of the options to
truewithlib.mkDefaultfails evaluation with "conflicting definition values", because the preset uses the same priority. This happens at any config version, before the notice shows. The upgrade notes say to set the option withoutlib.mkDefault.Docs:
docs/upgrading.md: a 0.2.0 entry with the check, the PAM case, the conflict error and the way back.docs/release-notes.md: a 0.2.0 entry.docs/introduction.mdand the SSH onion service section ofdocs/services.mdnow say that the preset turns off SSH password login.Nothing else in the repo uses SSH password login. The tests, the QEMU and krops deployment scripts and the deployment examples all log in with keys. The preset doesn't change
PermitRootLogin, so root keeps the NixOS defaultprohibit-password.Testing
nix build .#checks.x86_64-linux.module-configpasses. Two new tests:testSecureNodeSshKeysOnly: the preset givesfalsefor both options, an explicittruewins, and without the preset both staytrue. It fails with the preset from master.testVersioningSecureNodeSshPasswords: the notice fires with the preset and sshd, not with sshd disabled, not without the preset, and not for a 0.2.0 config once 0.2.0 is released.nix build .#checks.x86_64-linux.test-runnerpasses.nix eval .#ciTestInfopasses../test/run-tests.sh -s secureNodepasses.PasswordAuthentication = lib.mkDefault truefails with "conflicting definition values" before and after 0.2.0 is released.module-config,test-runner,ci-workflowsandsecureNodepass on the KVM host.acknowledgedreplacescurrent, because master now rejects config version 0.2.0 before the release. It checks that a config at 0.2.0 doesn't get the notice once 0.2.0 is released. On master, the notice is a warning until 0.2.0 is released, and the tests pass withversion.nixat 0.1.6 and at 0.2.0.Models
Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes plus rechecks), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283. Kimi K3.1 Pro (two passes) and Claude Fable 5.2 reviewed the second rebase.