Boundary OSS Tutorial "Connect to Your First Target" Couldn't Connect on WSL

Hi! So I’ve been having hard time to try the OSS Quick Start for Boundary at the part of “Connect to Your First Target” tutorial, with the details like…

[WSL CLI]

export AUTH_ID=ampw_1234567890
export TARGET_ID=ttcp_1234567890
boundary authenticate password -auth-method-id=$AUTH_ID -login-name=admin
Please enter the password (it will be hidden):

Authentication information:
Account ID: acctpw_1234567890
Auth Method ID: ampw_1234567890
Expiration Time: Wed, 19 Oct 2022 15:56:11 +07
User ID: u_1234567890
Error opening “pass” keyring: Specified keyring backend not available
The token was not successfully saved to a system keyring. The token is:

[token]

It must be manually passed in via the BOUNDARY_TOKEN env var or -token flag. Storing the token can also be disabled via -keyring-type=none.

export BOUNDARY_TOKEN=[token]
boundary targets read -id $TARGET_ID

Direct usage of BOUNDARY_TOKEN env var is deprecated; please use “-token env://” format, e.g. “-token env://BOUNDARY_TOKEN” to specify an env var to use.

Target information:
Created Time: Wed, 12 Oct 2022 15:40:59 +07
Description: Provides an initial target in Boundary
ID: ttcp_1234567890
Name: Generated target
Session Connection Limit: -1
Session Max Seconds: 28800
Type: tcp
Updated Time: Wed, 12 Oct 2022 15:40:59 +07
Version: 2

Scope:
ID: p_1234567890
Name: Generated project scope
Parent Scope ID: o_1234567890
Type: project

Authorized Actions:
no-op
read
update
delete
add-host-sources
set-host-sources
remove-host-sources
add-credential-sources
set-credential-sources
remove-credential-sources
authorize-session

Host Sources:
Host Catalog ID: hcst_1234567890
ID: hsst_1234567890

Attributes:
Default Port: 22

boundary connect ssh -target-id $TARGET_ID
Direct usage of BOUNDARY_TOKEN env var is deprecated; please use “-token env://” format, e.g. “-token env://BOUNDARY_TOKEN” to specify an env var to use.
kex_exchange_identification: Connection closed by remote host

By the part that says “kex_exchange_identification: Connection closed by remote host” I’ve tried to look it up for solutions on the internet and some tutorials, but sadly I didn’t able to solve the problem. The only information that I could get is Remote Login has to be enabled (for MacOS) but I was trying it on WSL that was based from Windows 10, and currently I had my Remote Desktop settings enabled. When I’ve tried to use sudo command, it just gave me this error :

Error opening keyring: Specified keyring backend not available
Token must be provided via BOUNDARY_TOKEN env var or -token flag. Reading the token can also be disabled via -keyring-type=none.
Error from controller when performing authorize-session action against given target

Error information:
Kind: Unauthenticated
Message: Unauthenticated, or invalid token.
Status: 401
context: Error from controller when performing authorize-session action against given target

Is there anything I could do to fix it? Thanks.

That first-target workflow is for connecting specifically to a host via SSH. Remote Desktop is a separate protocol (RDP). In WSL, if you don’t have SSH running (you should be able to check with ss -tlpn src localhost:22 – if there’s nothing listed, then the SSH service isn’t running in WSL) then the connection will fail.

Thank you for the reply, I have checked the ss -tlpn src localhost:22 and it doesn’t returns any list at all. Is there any way for me to run the SSH service on WSL?

Ohh… nevermind, I’ve tried to look at ssh for wsl2 and looks like it doesn’t started by default, so I had to type sudo service ssh start if I want to enable the ssh server, thanks for the help

1 Like

You can probably enable it on startup permanently with systemctl enable --now ssh if your WSL is using a systemd-based distribution.