Manage Sessions
Sessions are Boundary resources created when connecting to a Target. A target allows Boundary users to define an endpoint with a protocol and default port to establish a session. Unless specified with a -host-id
flag when establishing a session, Boundary will choose one Host from the target's Host Sets to connect to at random.
In this section, we'll show you the basics of how to start a session, view the session details, and cancel a session in Boundary using the CLI.
We assume you're running Boundary in dev
mode using the default target resource of ttcp_1234567890
. We also assume you've authenticated using the CLI. See the output of boundary dev
for these login values.
Start a Session
Connecting to a target creates a session in Boundary (via a call to the target to authorize a session for the user). To demonstrate what a session looks like we are going to connect to a tcp
target with a default port of 22 for SSH access.
For more information regarding different ways to connect to a target behind Boundary see Connect to Target under Getting Started and Advanced Session Establishment below.
View Sessions
View all sessions which Boundary has for the project p_1234567890
by listing them.
We can get a more detailed view of a specific session by reading it.
Cancel a Session
Boundary then cancels the session and move it into a "Terminated" state.
Advanced Session Establishment
Above, we discussed connecting to a target using the boundary connect
command. In addition to this we can create a session to a target and connect to that session in separate steps. This is accomplished using the boundary targets authorize-session
command, which generates an authorization token that a user can use to start a session via boundary connect -authz-token
at their own convenience.
Note: You can also provide a -host-id
flag in the request above which ensures connecting using the provided Authorization Token will connect you to this specific host.
With the above address and port information we can now connect to our local proxy and have our tcp traffic sent through the Boundary system.