End a session - AWS Systems Manager

End a session

You can use the AWS Systems Manager console or the AWS Command Line Interface (AWS CLI) to end a session that you started in your account. If you click the Terminate button for a session in the console or call the TerminateSession API action by using the AWS CLI, Session Manager permanently ends the session and closes the data connection between the Session Manager client and SSM Agent on the managed node. You can't resume a terminated session.

If there is no user activity in an open session for 20 minutes, the idle state triggers a timeout. Session Manager doesn't call TerminateSession, but it does close the underlying channel. You can't resume a session closed because of idle timeout.

Ending a session (console)

You can use the AWS Systems Manager console to end a session in your account.

To end a session (console)
  1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems-manager/.

  2. In the navigation pane, choose Session Manager.

  3. For Sessions, choose the option button to the left of the session you want to end.

  4. Choose Terminate.

Ending a session (AWS CLI)

To end a session using the AWS CLI, run the following command. Replace session-id with your own information.

aws ssm terminate-session \ --session-id session-id

For more information about the terminate-session command, see terminate-session in the AWS Systems Manager section of the AWS CLI Command Reference.