[GH-ISSUE #5148] Enforce ForceCommand sshd option #9989

Open
opened 2026-08-05 01:24:14 -04:00 by saavagebueno · 1 comment
Owner

Originally created by @ArthurPons on GitHub (Jan 21, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5148

To restrict a user to only a specific command (say ls) on a server accessible through netbird I use this sshd configuration in /etc/ssh/sshd_config :

Match user lsuser
    ForceCommand ls

When I log into said lsuser I expect the ls command to be automatically executed. I also expect any command to be ignored :

$ ssh lsuser@server
file1 file2 file3
$ ssh lsuser@server whoami
file1 file2 file3

Instead I get an interactive shell.

Ideally I would like for the sshd_config file to be applied even when using the netbird ssh so I don't have to think whether I'm using netbird ssh or openssh ssh.

Am I right tagging this as a missing feature or is it a bug ? What would be the best way to go about making it work in the meantime ?

Have a nice day,
Arthur

Originally created by @ArthurPons on GitHub (Jan 21, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5148 To restrict a user to only a specific command (say `ls`) on a server accessible through netbird I use this sshd configuration in `/etc/ssh/sshd_config` : ``` Match user lsuser ForceCommand ls ``` When I log into said lsuser I expect the `ls` command to be automatically executed. I also expect any command to be ignored : ``` $ ssh lsuser@server file1 file2 file3 $ ssh lsuser@server whoami file1 file2 file3 ``` Instead I get an interactive shell. Ideally I would like for the sshd_config file to be applied even when using the netbird ssh so I don't have to think whether I'm using netbird ssh or openssh ssh. Am I right tagging this as a missing feature or is it a bug ? What would be the best way to go about making it work in the meantime ? Have a nice day, Arthur
saavagebueno added the feature-request label 2026-08-05 01:24:14 -04:00
Author
Owner

@crntnvdl commented on GitHub (Jun 16, 2026):

Would love this feature, combined with ephemeral peers this could harden automated operations by restricting the commands the peer can run.

<!-- gh-comment-id:4716546961 --> @crntnvdl commented on GitHub (Jun 16, 2026): Would love this feature, combined with ephemeral peers this could harden automated operations by restricting the commands the peer can run.
Sign in to join this conversation.
No Label feature-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#9989