[PR #1508] [MERGED] Disable SSH server by default on client side and add the flag --allow-server-ssh to enable it #13840

Closed
opened 2026-08-05 02:09:05 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/1508
Author: @charnesp
Created: 1/30/2024
Status: Merged
Merged: 2/20/2024
Merged by: @mlsmaycon

Base: mainHead: main


📝 Commits (10+)

  • ea3730d Temporary patch removing SSH server on Client
  • eb00be1 Merge pull request #1 from charnesp/no-ssh-server-on-client
  • 0f352c6 Add SSHAllowed in Config file
  • c3a8822 WIP for
  • e548494 SSH allowed flag added to conf
  • c88fe59 Merge branch 'netbirdio:main' into main
  • 7b97787 Merge pull request #2 from charnesp/ssh-allowed-params
  • 2d139cb Merge branch 'netbirdio:main' into main
  • cdfc8ee Merge branch 'netbirdio:main' into main
  • 27764a8 Merge branch 'netbirdio:main' into main

📊 Changes

10 files changed (+296 additions, -199 deletions)

View changed files

📝 client/cmd/root.go (+4 -1)
📝 client/cmd/up.go (+8 -0)
📝 client/internal/config.go (+26 -7)
📝 client/internal/connect.go (+2 -0)
📝 client/internal/engine.go (+43 -33)
📝 client/internal/engine_test.go (+1 -0)
📝 client/proto/daemon.pb.go (+170 -158)
📝 client/proto/daemon.proto (+2 -0)
📝 client/server/server.go (+5 -0)
📝 util/common.go (+35 -0)

📄 Description

Describe your changes

I add in the configuration of the Netbird client the option to allow (or not) the launch of an SSH server on the peer.

The client-side control of the SSH server option on the client side of Netbird create a root access to all peers by Netbird administrators, thus an important security issue.

This changes the default behavior for new peers, by requiring the agent to be executed with allow-server-ssh set to true in order for the management configuration to take effect. See example commands below:

To enable SSH

netbird down
netbird up --allow-server-ssh

To disable SSH

netbird down
netbird up --allow-server-ssh=false

Existing peers will have SSH enabled in the same way as the previous version. You can disable it with the commands above.

https://github.com/netbirdio/netbird/issues/509 and https://github.com/netbirdio/netbird/issues/683

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 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/1508 **Author:** [@charnesp](https://github.com/charnesp) **Created:** 1/30/2024 **Status:** ✅ Merged **Merged:** 2/20/2024 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`ea3730d`](https://github.com/netbirdio/netbird/commit/ea3730d29a442fc9f57c06e9f1f68dba017427df) Temporary patch removing SSH server on Client - [`eb00be1`](https://github.com/netbirdio/netbird/commit/eb00be1d06299517c60c479eab57e1af8561ac9b) Merge pull request #1 from charnesp/no-ssh-server-on-client - [`0f352c6`](https://github.com/netbirdio/netbird/commit/0f352c686ad4eda6ef7141e09a6b9a9e0fd98e2a) Add SSHAllowed in Config file - [`c3a8822`](https://github.com/netbirdio/netbird/commit/c3a8822b929b08cc4fc8de1f43504493c15c14b0) WIP for - [`e548494`](https://github.com/netbirdio/netbird/commit/e5484949ddd557c595df9c89d93f5c4c8f959e72) SSH allowed flag added to conf - [`c88fe59`](https://github.com/netbirdio/netbird/commit/c88fe595d20f020d9eb600798498445f0df737aa) Merge branch 'netbirdio:main' into main - [`7b97787`](https://github.com/netbirdio/netbird/commit/7b97787e9fdff9e50f3dc9d72c8031814da965bc) Merge pull request #2 from charnesp/ssh-allowed-params - [`2d139cb`](https://github.com/netbirdio/netbird/commit/2d139cb68edee16ea886de564b4166a9f98f35f9) Merge branch 'netbirdio:main' into main - [`cdfc8ee`](https://github.com/netbirdio/netbird/commit/cdfc8eef3c74f9a0a7021fb025254a66a537d09b) Merge branch 'netbirdio:main' into main - [`27764a8`](https://github.com/netbirdio/netbird/commit/27764a8b37a5563d59e50da56fb20c961e515e31) Merge branch 'netbirdio:main' into main ### 📊 Changes **10 files changed** (+296 additions, -199 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/root.go` (+4 -1) 📝 `client/cmd/up.go` (+8 -0) 📝 `client/internal/config.go` (+26 -7) 📝 `client/internal/connect.go` (+2 -0) 📝 `client/internal/engine.go` (+43 -33) 📝 `client/internal/engine_test.go` (+1 -0) 📝 `client/proto/daemon.pb.go` (+170 -158) 📝 `client/proto/daemon.proto` (+2 -0) 📝 `client/server/server.go` (+5 -0) 📝 `util/common.go` (+35 -0) </details> ### 📄 Description ## Describe your changes I add in the configuration of the Netbird client the option to allow (or not) the launch of an SSH server on the peer. The client-side control of the SSH server option on the client side of Netbird create a root access to all peers by Netbird administrators, thus an important security issue. This changes the default behavior for **new peers**, by requiring the agent to be executed with allow-server-ssh set to true in order for the management configuration to take effect. See example commands below: To enable SSH ```shell netbird down netbird up --allow-server-ssh ``` To disable SSH ```shell netbird down netbird up --allow-server-ssh=false ``` > Existing peers will have SSH enabled in the same way as the previous version. You can disable it with the commands above. ## Issue ticket number and link https://github.com/netbirdio/netbird/issues/509 and https://github.com/netbirdio/netbird/issues/683 ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <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 02:09:05 -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#13840