[GH-ISSUE #5531] Can't connect using netbird ssh, temporarily fixed by opening an SSH session in the browser #11385

Open
opened 2026-08-05 01:29:31 -04:00 by saavagebueno · 5 comments
Owner

Originally created by @scarylizard on GitHub (Mar 6, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5531

Describe the problem

Using netbird ssh doesn't work. Authentication is successful, but it gives the following error:

Waiting for authentication...
Authentication successful!
Failed to connect to user@<Netbird IP>:22

Troubleshooting steps:
  1. Check peer connectivity: netbird status -d
  2. Verify SSH server is enabled on the peer
  3. Ensure correct hostname/IP is used
Error: dial <Netbird IP>:22: ssh handshake: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

Opening up an SSH session in the web browser works, and after that using netbird ssh works for some time.

Are you using NetBird Cloud?

Yes.

NetBird version

Target version: 0.66.2

Client version: 0.65.3 (this is the latest version in NixOS unstable)

Is any other VPN software installed?

No.

Originally created by @scarylizard on GitHub (Mar 6, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5531 **Describe the problem** Using `netbird ssh` doesn't work. Authentication is successful, but it gives the following error: ``` Waiting for authentication... Authentication successful! Failed to connect to user@<Netbird IP>:22 Troubleshooting steps: 1. Check peer connectivity: netbird status -d 2. Verify SSH server is enabled on the peer 3. Ensure correct hostname/IP is used Error: dial <Netbird IP>:22: ssh handshake: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain ``` Opening up an SSH session in the web browser works, and after that using `netbird ssh` works for some time. **Are you using NetBird Cloud?** Yes. **NetBird version** Target version: `0.66.2` Client version: `0.65.3` (this is the latest version in NixOS unstable) **Is any other VPN software installed?** No.
saavagebueno added the triage-needed label 2026-08-05 01:29:31 -04:00
Author
Owner

@Hazard4U commented on GitHub (Mar 9, 2026):

I have the same issue

<!-- gh-comment-id:4021997050 --> @Hazard4U commented on GitHub (Mar 9, 2026): I have the same issue
Author
Owner

@Raylands commented on GitHub (Mar 15, 2026):

Same here, but I can't even connect via web.

Disabling "DisableSSHAuth" fixes it.

<!-- gh-comment-id:4063170902 --> @Raylands commented on GitHub (Mar 15, 2026): Same here, but I can't even connect via web. Disabling "DisableSSHAuth" fixes it.
Author
Owner

@Dazag commented on GitHub (May 1, 2026):

Raylands, where can you adjust that? If i use it as in netbird up --disable--ssh-auth, it doesn't work. How did you do it? I still have the teporary ssh policy that I can't find anywhere

<!-- gh-comment-id:4359205059 --> @Dazag commented on GitHub (May 1, 2026): Raylands, where can you adjust that? If i use it as in netbird up --disable--ssh-auth, it doesn't work. How did you do it? I still have the teporary ssh policy that I can't find anywhere
Author
Owner

@Raylands commented on GitHub (May 3, 2026):

On linux it's /var/lib/netbird/default.json. Other option is to delete the temp rule (in access control is a button next to the "rows per page" dropdown) and that enables regular ssh again.

<!-- gh-comment-id:4365847371 --> @Raylands commented on GitHub (May 3, 2026): On linux it's /var/lib/netbird/default.json. Other option is to delete the temp rule (in access control is a button next to the "rows per page" dropdown) and that enables regular ssh again.
Author
Owner

@albertoradice commented on GitHub (May 4, 2026):

Hi, we're experiencing the same issue.

We're running the self-hosted version of NetBird (v0.70.4). Both peers, the client (MacBook Air) and the server (Ubuntu 24.04), are also on v0.70.4.

When running netbird ssh from the client, we consistently hit one of two errors depending on whether the token cache is used or not.

1. With cached authentication token

➜  ~ netbird ssh -l debug USER@HOST
2026-05-04T14:48:57.047+02:00 DEBG client/ssh/detection/detection.go:82: SSH server banner: SSH-2.0-NetBird-SSH-Server-0.70.4 NetBird-JWT-Required
2026-05-04T14:48:57.048+02:00 DEBG client/ssh/common.go:105: Using cached authentication token
2026-05-04T14:48:57.099+02:00 DEBG client/ssh/client/client.go:326: connection close after handshake failure: close tcp 100.85.108.208:51107->100.85.137.104:22: use of closed network connection
Failed to connect to USER@HOST:22
Troubleshooting steps:
  1. Check peer connectivity: netbird status -d
  2. Verify SSH server is enabled on the peer
  3. Ensure correct hostname/IP is used
Error: dial HOST:22: ssh handshake: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

2. With -no-cache flag

netbird ssh -no-cache -l debug USER@HOST
2026-05-04T14:49:14.930+02:00 DEBG client/ssh/detection/detection.go:82: SSH server banner: SSH-2.0-NetBird-SSH-Server-0.70.4 NetBird-JWT-Required
SSH authentication required.
Please do the SSO login in your browser.
If your browser didn't open automatically, use this URL to log in:
Waiting for authentication...
Failed to connect to USER@HOST:22
Troubleshooting steps:
  1. Check peer connectivity: netbird status -d
  2. Verify SSH server is enabled on the peer
  3. Ensure correct hostname/IP is used
Error: dial HOST:22: request JWT token: wait for JWT token: rpc error: code = InvalidArgument desc = invalid device code or no active auth flow

Interestingly, we are able to log in normally through the web UI using a temporary peer via SSH, so the issue appears to be specific to the netbird ssh CLI command.

Happy to provide any additional logs or details if that would help.

<!-- gh-comment-id:4371376297 --> @albertoradice commented on GitHub (May 4, 2026): Hi, we're experiencing the same issue. We're running the self-hosted version of NetBird (v0.70.4). Both peers, the client (MacBook Air) and the server (Ubuntu 24.04), are also on v0.70.4. When running `netbird ssh` from the client, we consistently hit one of two errors depending on whether the token cache is used or not. **1. With cached authentication token** ``` ➜ ~ netbird ssh -l debug USER@HOST 2026-05-04T14:48:57.047+02:00 DEBG client/ssh/detection/detection.go:82: SSH server banner: SSH-2.0-NetBird-SSH-Server-0.70.4 NetBird-JWT-Required 2026-05-04T14:48:57.048+02:00 DEBG client/ssh/common.go:105: Using cached authentication token 2026-05-04T14:48:57.099+02:00 DEBG client/ssh/client/client.go:326: connection close after handshake failure: close tcp 100.85.108.208:51107->100.85.137.104:22: use of closed network connection Failed to connect to USER@HOST:22 Troubleshooting steps: 1. Check peer connectivity: netbird status -d 2. Verify SSH server is enabled on the peer 3. Ensure correct hostname/IP is used Error: dial HOST:22: ssh handshake: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain ``` **2. With `-no-cache` flag** ``` netbird ssh -no-cache -l debug USER@HOST 2026-05-04T14:49:14.930+02:00 DEBG client/ssh/detection/detection.go:82: SSH server banner: SSH-2.0-NetBird-SSH-Server-0.70.4 NetBird-JWT-Required SSH authentication required. Please do the SSO login in your browser. If your browser didn't open automatically, use this URL to log in: Waiting for authentication... Failed to connect to USER@HOST:22 Troubleshooting steps: 1. Check peer connectivity: netbird status -d 2. Verify SSH server is enabled on the peer 3. Ensure correct hostname/IP is used Error: dial HOST:22: request JWT token: wait for JWT token: rpc error: code = InvalidArgument desc = invalid device code or no active auth flow ``` Interestingly, we are able to log in normally through the web UI using a temporary peer via SSH, so the issue appears to be specific to the `netbird ssh` CLI command. Happy to provide any additional logs or details if that would help.
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#11385