[GH-ISSUE #4869] SSH broken on Debian 13 due to new login package #9456

Open
opened 2026-08-05 01:22:11 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @afonsofrancof on GitHub (Nov 27, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/4869

Environment

  • NetBird Version: 0.60.3
  • OS: Debian 13 (Trixie)
  • Architecture: amd64
  • Installation Method: apt repository

Description

NetBird SSH connections fail immediately on Debian 13 (Trixie) systems. After successful authentication and PTY allocation, the session closes immediately without spawning an interactive shell. Non-interactive commands work correctly.

Root Cause

After looking through logs and debugging this issue for hours I finally found the cause.

NetBird's SSH server uses login with some flags for interactive sessions which works fine with shadow-login (Debian 12) but fails with util-linux login (Debian 13).

Debian 13 switched from shadow's to util-linux implementation of the login binary (check the right side of the page on those two links. It also shows it on the man page of the packages). The util-linux version behaves differently when invoked by NetBird and exits instead of spawning an interactive shell.

Behavior

  • Connection authenticates successfully
  • PTY allocation is accepted
  • Shell request is accepted
  • Session immediately closes
  • Non-interactive commands work: ssh user@peer 'echo test' succeeds

Receiving peer logs (without prefix because of horizontal space):

... client/ssh/server/server.go:607: SSH connection from NetBird peer 100.64.0.5:62942 allowed

... client/ssh/server/session_handlers.go:35: SSH session started

... client/ssh/server/command_execution_unix.go:147: starting interactive shell: /usr/bin/login

Connecting peer output

❯ ssh afonso@togepi.netbird.selfhosted
Shared connection to togepi.netbird.selfhosted closed.

Workaround

The only way I could get NetBird's ssh to work again was to do the following:

1 - Edit /etc/apt/sources.list and change the repositories back to bookworm
2 - sudo apt update
3 - sudo apt install login=1:4.13+dfsg1-1+deb12u1
4 - Use NetBird's SSH (here I didn't use netbird.selfhosted suffix but it's the same)

Image

This is obviously not desired and I only used it for testing.

Change

Something needs to change here

aca0398105/client/ssh/server/userswitching_unix.go (L77-L100)

I will try to experiment with some of the login command flags and will report back in case I find something.

Hope this can be fixed.
I was going crazy trying to get this to work 😅

Originally created by @afonsofrancof on GitHub (Nov 27, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/4869 # Environment - **NetBird Version**: 0.60.3 - **OS**: Debian 13 (Trixie) - **Architecture**: amd64 - **Installation Method**: apt repository # Description NetBird SSH connections fail immediately on Debian 13 (Trixie) systems. After successful authentication and PTY allocation, the session closes immediately without spawning an interactive shell. Non-interactive commands work correctly. # Root Cause After looking through logs and debugging this issue for **hours** I finally found the cause. NetBird's SSH server uses `login` with some flags for interactive sessions which works fine with shadow-login (Debian 12) but fails with util-linux login (Debian 13). Debian 13 switched from [shadow's](https://packages.debian.org/bookworm/login) to [util-linux](https://packages.debian.org/trixie/login) implementation of the `login` binary (check the right side of the page on those two links. It also shows it on the man page of the packages). The util-linux version behaves differently when invoked by NetBird and exits instead of spawning an interactive shell. # Behavior - Connection authenticates successfully - PTY allocation is accepted - Shell request is accepted - Session immediately closes - Non-interactive commands work: `ssh user@peer 'echo test'` succeeds ## Receiving peer logs (without prefix because of horizontal space): ``` ... client/ssh/server/server.go:607: SSH connection from NetBird peer 100.64.0.5:62942 allowed ... client/ssh/server/session_handlers.go:35: SSH session started ... client/ssh/server/command_execution_unix.go:147: starting interactive shell: /usr/bin/login ``` ## Connecting peer output ``` ❯ ssh afonso@togepi.netbird.selfhosted Shared connection to togepi.netbird.selfhosted closed. ``` ### Workaround The only way I could get NetBird's ssh to work again was to do the following: 1 - Edit `/etc/apt/sources.list` and change the repositories back to `bookworm` 2 - `sudo apt update` 3 - `sudo apt install login=1:4.13+dfsg1-1+deb12u1` 4 - Use NetBird's SSH (here I didn't use `netbird.selfhosted` suffix but it's the same) <img width="930" height="246" alt="Image" src="https://github.com/user-attachments/assets/65c7654e-199c-4f60-b8df-dd799f33a614" /> This is obviously not desired and I only used it for testing. # Change Something needs to change here https://github.com/netbirdio/netbird/blob/aca0398105fd0662c09533e1368a8682310efd94/client/ssh/server/userswitching_unix.go#L77-L100 I will try to experiment with some of the `login` command flags and will report back in case I find something. Hope this can be fixed. I was going crazy trying to get this to work 😅
saavagebueno added the triage-needed label 2026-08-05 01:22:11 -04:00
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#9456