How can I connect to my Linux Amazon WorkSpaces using SSH?

If you are having difficulty connecting to your Linux WorkSpace through the Amazon WorkSpaces client, or if you prefer using the AWS Command Line Interface (AWS CLI), you can use SSH to connect to your Linux WorkSpace. 

Find the WorkSpace IP address and Username

1.    Open the Amazon WorkSpaces console.

2.    In the navigation pane, choose WorkSpaces.

3.    Choose your WorkSpace, expand the arrow, and then note the following:

  • The WorkSpace IP (this is the private IP address of the WorkSpace).
  • Your WorkSpace Username.

Note: The private IP address is required for getting the elastic network interface associated with the WorkSpace, from which you can then retrieve information such as the security group or public IP address associated with the WorkSpace.

Add a Rule

1.    Open the Amazon Elastic Compute Cloud (Amazon EC2) console.

2.    Under Network & Security, choose Network Interfaces from the navigation pane.

3.    In the search bar, enter the WorkSpace private IP address that you noted earlier.

If you're going to connect to the WorkSpace from outside your VPC, note the IPv4 Public IP address.

4.    Choose the link from under the Security groups column.

5.    Choose the Inbound tab, and then choose Edit.

6.    Choose Add Rule, and then enter the following values:

  • Type: SSH
  • Protocol: TCP
  • Port Range: 22
  • Source: If you're connecting from outside the VPC, choose MyIP, and then enter the IP address for every remote machine. Otherwise, choose Custom, and then enter the private IP address of another EC2 instance in the same VPC.
  • Description: Enter a description for your rule.

7.    Choose Save.

Find the NetBIOS name of your directory

1.    Open the Directory Service console.

2.    Choose the Directory ID for your directory.

3.    Note the Directory NetBIOS name.

Connect to your Linux WorkSpace using Linux

1.    Enter the following command, replacing the values with the NetBIOS name, Username, and WorkSpace IP that you noted in earlier steps.

ssh "NetBIOS_NAME\Username"@WorkSpaceIP

The following is an example of the SSH command where:

  • The NetBIOS_NAME is testcompany
  • The Username is testuser
  • The WorkSpace IP is 123.456.789.10
ssh "testcompany\testuser"@123.456.789.10

2.    When prompted, enter the same password you use when authenticating with the WorkSpaces client--that is, your Active Directory password.

Connect to your Linux WorkSpace using PuTTY

1.    In the PuTTY Configuration window, enter the following values:

  • For Host Name (or IP address) enter the following command. (See an example of the SSH command under Linux, in the preceding section.) Replace the values with the NetBIOS name, Username, and WorkSpace IP that you noted in earlier steps:
"NetBIOS_NAME\Username"@WorkSpaceIP
  • For Port, enter 22.
  • For Connection type, choose SSH

2.    Choose Open.

3.    When prompted, enter the same password you use when authenticating with the WorkSpaces client--that is, your Active Directory password.


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2018-09-24