[PR #5382] [client] ssh: fix #5345 by implementing PTY support in executor and removing setsid wrapper #22886

Open
opened 2026-08-05 06:06:31 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5382
Author: @pieterhollander
Created: 2/18/2026
Status: 🔄 Open

Base: mainHead: fix/ssh-executor-pty-support


📝 Commits (7)

  • 4ad02a9 ssh: implement PTY support in executor and remove setsid wrapper
  • 0f3419b ssh: remove unreachable exit after exec
  • dff7ee6 Update client/ssh/server/executor_unix.go
  • 52748b6 Update client/ssh/server/executor_unix.go
  • 8e7f9ea ssh: update getLinuxLoginCmd doc comment to reflect current behavior
  • 4fd1a1b Merge remote-tracking branch 'origin/main' into fix/ssh-executor-pty-support
  • 4476d45 Merge branch 'main' into fix/ssh-executor-pty-support

📊 Changes

8 files changed (+91 additions, -60 deletions)

View changed files

📝 client/cmd/ssh_exec_unix.go (+1 -1)
📝 client/ssh/server/command_execution_js.go (+0 -5)
📝 client/ssh/server/command_execution_unix.go (+0 -24)
📝 client/ssh/server/command_execution_windows.go (+0 -5)
📝 client/ssh/server/executor_unix.go (+60 -5)
📝 client/ssh/server/executor_unix_test.go (+23 -0)
📝 client/ssh/server/server.go (+1 -3)
📝 client/ssh/server/userswitching_unix.go (+6 -17)

📄 Description

I tried to implement the existing TODO and fix #5345 myself.
I tested the PR on a few systems, including an Incus container.

  • Documentation is not needed for this change (explain why)

The change does not change anything for end-users, but fixes Netbird SSH being unusable on containers.

Summary by CodeRabbit

  • New Features

    • Enabled PTY support during privilege-drop execution with improved terminal preparation and privilege validation.
  • Documentation

    • Simplified the user-facing --pty flag help text.
  • Chores

    • Removed legacy util-linux login detection and streamlined startup/terminal handling.
  • Tests

    • Updated privilege-dropper tests to use dynamic user/group values and added a PTY-specific test.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5382 **Author:** [@pieterhollander](https://github.com/pieterhollander) **Created:** 2/18/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/ssh-executor-pty-support` --- ### 📝 Commits (7) - [`4ad02a9`](https://github.com/netbirdio/netbird/commit/4ad02a91a4c1d62b150449443fd1e7fecda4acab) ssh: implement PTY support in executor and remove setsid wrapper - [`0f3419b`](https://github.com/netbirdio/netbird/commit/0f3419b2e181edbd130cf30ac15fbd41154381ce) ssh: remove unreachable exit after exec - [`dff7ee6`](https://github.com/netbirdio/netbird/commit/dff7ee6c072cc902da09a0a0174e30ac7f739113) Update client/ssh/server/executor_unix.go - [`52748b6`](https://github.com/netbirdio/netbird/commit/52748b6acd4d6d2798727294b06834aa25caf9c2) Update client/ssh/server/executor_unix.go - [`8e7f9ea`](https://github.com/netbirdio/netbird/commit/8e7f9ea88a7d01c9e47fb13b69d314bf36986b02) ssh: update getLinuxLoginCmd doc comment to reflect current behavior - [`4fd1a1b`](https://github.com/netbirdio/netbird/commit/4fd1a1b299337150444c16550f968c6e32cdb7dc) Merge remote-tracking branch 'origin/main' into fix/ssh-executor-pty-support - [`4476d45`](https://github.com/netbirdio/netbird/commit/4476d45fda5857d5243a084a58f893a0c86eed6b) Merge branch 'main' into fix/ssh-executor-pty-support ### 📊 Changes **8 files changed** (+91 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/ssh_exec_unix.go` (+1 -1) 📝 `client/ssh/server/command_execution_js.go` (+0 -5) 📝 `client/ssh/server/command_execution_unix.go` (+0 -24) 📝 `client/ssh/server/command_execution_windows.go` (+0 -5) 📝 `client/ssh/server/executor_unix.go` (+60 -5) 📝 `client/ssh/server/executor_unix_test.go` (+23 -0) 📝 `client/ssh/server/server.go` (+1 -3) 📝 `client/ssh/server/userswitching_unix.go` (+6 -17) </details> ### 📄 Description I tried to implement the existing TODO and fix #5345 myself. I tested the PR on a few systems, including an Incus container. * [x] Documentation is **not needed** for this change (explain why) The change does not change anything for end-users, but fixes Netbird SSH being unusable on containers. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Enabled PTY support during privilege-drop execution with improved terminal preparation and privilege validation. * **Documentation** * Simplified the user-facing --pty flag help text. * **Chores** * Removed legacy util-linux login detection and streamlined startup/terminal handling. * **Tests** * Updated privilege-dropper tests to use dynamic user/group values and added a PTY-specific test. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 06:06:31 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#22886