Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/ssh: expose StreamLocalBindUnlink sshd config option #48447

Conversation

charles-dyfis-net
Copy link
Contributor

Motivation for this change

This option is needed on the server side for forwarding GnuPG agent connections over ssh to behave properly. With the option in question set, the directions given in https://wiki.gnupg.org/AgentForwarding work properly when connecting from a SSH client (with a hardware keystore accessible to the local agent) to a NixOS-based server (performing operations which requires those keys).

While this could otherwise be manually enabled by users using config.services.openssh.extraConfig, having high-utility functionality that depends on this flag being set to a non-default value argues in favor of exposing it directly.

Things done
  • Tested via nixos-rebuild build-vm, and validating ssh -T within that guest.
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • N/A Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • N/A Tested execution of all binary files (usually in ./result/bin/)
  • N/A Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Needed on the server side for forwarding GnuPG agent connections over ssh to behave properly.
@@ -110,6 +110,15 @@ in
'';
};

streamLocalBindUnlink = mkOption {
type = types.enum ["yes" "no"];
default = "no";
Copy link
Member

Choose a reason for hiding this comment

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

How about using types.bool instead

@FRidh
Copy link
Member

FRidh commented Oct 15, 2018

While this could otherwise be manually enabled by users using config.services.openssh.extraConfig, having high-utility functionality that depends on this flag being set to a non-default value argues in favor of exposing it directly.

There are reasons for not always directly exposing all options. Exposing all options adds code bloat, takes maintenance, and will typically lag the options provided by the tool. Of course, adding them does allow for (additional) validation.

@charles-dyfis-net
Copy link
Contributor Author

Hmm. The internal motivation that led to this PR being offered was forwards compatibility: If I added the flag to my configuration using extraConfig now, and a future version of nixpkgs added a separate option, that could potentially lead to a broken configuration; getting in front of that change was thus intended to reduce that window of potential breakage (by making it happen sooner rather than later).

If it's not likely to ever be accepted, then that motivation goes away.

@charles-dyfis-net
Copy link
Contributor Author

On further consideration, I consider @FRidh's argument compelling, and am withdrawing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants