[GH-ISSUE #5917] SSH connections stop working after some time #12347

Open
opened 2026-08-05 02:05:43 -04:00 by saavagebueno · 4 comments
Owner

Originally created by @drcongo on GitHub (Apr 18, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5917

Describe the problem

I've set up some SSH access policies using Netbird SSH (we're using Netbird Cloud), and the first connection of the day works fine with ssh user@vpn or whatever. However, after a yet to be determined amount of time (under an hour), that same command will start returning this...

SSH connection to NetBird server failed: SSH handshake: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

The logs on the server I'm trying to reach show this...

2026-04-18T11:03:05.878+01:00 INFO client/ssh/server/server.go:784: SSH connection from NetBird peer 100.96.172.209:51496 allowed
2026-04-18T11:03:06.567+01:00 INFO client/ssh/server/server.go:784: SSH connection from NetBird peer 100.96.172.209:51501 allowed
2026-04-18T11:03:07.198+01:00 INFO client/ssh/server/server.go:468: JWT validator initialized successfully
2026-04-18T11:03:07.199+01:00 ERRO shared/auth/jwt/validator.go:225: token could not be parsed: token has invalid claims: token is expired
2026-04-18T11:03:07.199+01:00 WARN [session: user@100.96.172.209:51501] client/ssh/server/server.go:615: JWT authentication failed: validate token (expected issuer=https://login.netbird.io/, audiences=[https://app.wiretrustee.com/], actual issuer=https://login.netbird.io/, audience=[https://app.wiretrustee.com/ https://wiretrustee.eu.auth0.com/userinfo]): token could not be parsed: token has invalid claims: token is expired
2026-04-18T11:08:09.078+01:00 INFO [peer: WMu1QZ39iD4dpg380pjbUc/gvBQwqex1qFxw4r58rms=] client/internal/peer/state_dump.go:79: Dump stat: Status: Connected, SentOffer: 5, RemoteOffer: 1, RemoteAnswer: 2, RemoteCandidate: 14, P2PConnected: 2, SwitchToRelay: 0, WGCheckSuccess: 24, RelayConnected: 2, LocalProxies: 2

These show that the server claims the token is expired, but one would expect this to trigger the auth flow. If I wait a few minutes, connections start working again. However, this is no use when I often need access urgently.

To Reproduce

Steps to reproduce the behavior:

  1. ssh into a server
  2. wait some time
  3. try ssh again

Expected behavior

If the token has expired, I'd expect the auth flow to trigger. If not, I'd expect the connection to succeed.

Are you using NetBird Cloud?

Yes, using Netbird Cloud

NetBird version

0.68.3 at both ends

Is any other VPN software installed?

Not on the server.

Originally created by @drcongo on GitHub (Apr 18, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5917 **Describe the problem** I've set up some SSH access policies using Netbird SSH (we're using Netbird Cloud), and the first connection of the day works fine with `ssh user@vpn` or whatever. However, after a yet to be determined amount of time (under an hour), that same command will start returning this... ``` SSH connection to NetBird server failed: SSH handshake: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain ``` The logs on the server I'm trying to reach show this... ``` 2026-04-18T11:03:05.878+01:00 INFO client/ssh/server/server.go:784: SSH connection from NetBird peer 100.96.172.209:51496 allowed 2026-04-18T11:03:06.567+01:00 INFO client/ssh/server/server.go:784: SSH connection from NetBird peer 100.96.172.209:51501 allowed 2026-04-18T11:03:07.198+01:00 INFO client/ssh/server/server.go:468: JWT validator initialized successfully 2026-04-18T11:03:07.199+01:00 ERRO shared/auth/jwt/validator.go:225: token could not be parsed: token has invalid claims: token is expired 2026-04-18T11:03:07.199+01:00 WARN [session: user@100.96.172.209:51501] client/ssh/server/server.go:615: JWT authentication failed: validate token (expected issuer=https://login.netbird.io/, audiences=[https://app.wiretrustee.com/], actual issuer=https://login.netbird.io/, audience=[https://app.wiretrustee.com/ https://wiretrustee.eu.auth0.com/userinfo]): token could not be parsed: token has invalid claims: token is expired 2026-04-18T11:08:09.078+01:00 INFO [peer: WMu1QZ39iD4dpg380pjbUc/gvBQwqex1qFxw4r58rms=] client/internal/peer/state_dump.go:79: Dump stat: Status: Connected, SentOffer: 5, RemoteOffer: 1, RemoteAnswer: 2, RemoteCandidate: 14, P2PConnected: 2, SwitchToRelay: 0, WGCheckSuccess: 24, RelayConnected: 2, LocalProxies: 2 ``` These show that the server claims the token is expired, but one would expect this to trigger the auth flow. If I wait a few minutes, connections start working again. However, this is no use when I often need access urgently. **To Reproduce** Steps to reproduce the behavior: 1. ssh into a server 2. wait some time 3. try ssh again **Expected behavior** If the token has expired, I'd expect the auth flow to trigger. If not, I'd expect the connection to succeed. **Are you using NetBird Cloud?** Yes, using Netbird Cloud **NetBird version** `0.68.3` at both ends **Is any other VPN software installed?** Not on the server.
saavagebueno added the triage-needed label 2026-08-05 02:05:43 -04:00
Author
Owner

@drcongo commented on GitHub (Apr 28, 2026):

Just happened again - the gap between two ssh commands was 14 minutes.

<!-- gh-comment-id:4334937957 --> @drcongo commented on GitHub (Apr 28, 2026): Just happened again - the gap between two ssh commands was 14 minutes.
Author
Owner

@drcongo commented on GitHub (Apr 28, 2026):

Update - the time taken before I'm able to use Netbird SSH again appears to be 60 minutes. Obviously this is less than ideal for getting work done.

<!-- gh-comment-id:4335345130 --> @drcongo commented on GitHub (Apr 28, 2026): Update - the time taken before I'm able to use Netbird SSH again appears to be 60 minutes. Obviously this is less than ideal for getting work done.
Author
Owner

@lixmal commented on GitHub (Apr 28, 2026):

Did you set netbird up --ssh-jwt-cache-ttl to something >10min on the client side?

<!-- gh-comment-id:4335466255 --> @lixmal commented on GitHub (Apr 28, 2026): Did you set `netbird up --ssh-jwt-cache-ttl` to something >10min on the client side?
Author
Owner

@drcongo commented on GitHub (May 2, 2026):

@lixmal I did when I initially set things up, then reduced it to 10m in the hope it would fix this issue, but it hasn't.

<!-- gh-comment-id:4364433834 --> @drcongo commented on GitHub (May 2, 2026): @lixmal I did when I initially set things up, then reduced it to 10m in the hope it would fix this issue, but it hasn't.
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#12347