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

I'm unable to connect to my Linux WorkSpace using the Amazon WorkSpaces client.-or-I want to use the AWS Command Line Interface (AWS CLI) with my Linux WorkSpace.How do I use SSH to connect to my Linux WorkSpace?ResolutionTo connect to your Linux WorkSpace using SSH, first identify the WorkSpace IP address and user name, and the NetBIOS name of your directory. Then, connect to your WorkSpace using Linux or PuTTY. Follow these steps:Note: If you receive errors when running AWS CLI commands, make sure that you’re using the most recent version of the AWS CLI.Find the WorkSpace IP address and user name1.    Open the Amazon WorkSpaces console, and then choose WorkSpaces from the navigation pane.2.    Choose the arrow next to your WorkSpace to expand the WorkSpace details. Note the WorkSpace IP and the Username. You will use this information later in this procedure.Note: The WorkSpace IP is the private IP address of the WorkSpace, and is required to associate the elastic network interface with the WorkSpace. You can then retrieve information such as the security group or public IP address associated with the WorkSpace.Add a rule1.    Open the Amazon Elastic Compute Cloud (Amazon EC2) console, and then choose Network Interfaces from the navigation pane.2.    In the search bar, enter the WorkSpace IP address that you noted earlier.Important: If you plan to connect to the WorkSpace from outside your virtual private cloud (VPC), note the IPv4 Public IP address.3.    Choose the link from under the Security groups column.4.    Choose the Inbound tab, and then choose Edit.5.    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 My IP, and then enter the IP address for each remote machine. Otherwise, choose Custom, and then enter the private IP address of another Amazon EC2 instance in the same VPC. Important: Don't enter 0.0.0.0/0 or allow IP addresses that don't need access.  Description: Enter a description for your rule.6.    Choose Save.Find the NetBIOS name of your directory1.    Open the Directory Service console.2.    Choose the Directory ID link for your directory.3.    Note the Directory NetBIOS name.Connect to your Linux WorkSpace using Linux1.    Enter the following command, replacing NetBIOS_NAME, Username, and WorkSpaceIP with the values that you noted in earlier steps.ssh "NetBIOS_NAME\Username"@WorkSpaceIPThe following is an example of the SSH command where:The NetBIOS_NAME is testcompanyThe Username is testuserThe WorkSpaceIP is 123.456.789.10ssh "testcompany\testuser"@123.456.789.102.    When prompted, enter the same password that you use when authenticating with the WorkSpaces client.Note: This is your Active Directory password.Connect to your Linux WorkSpace using PuTTY1.    In the PuTTY Configuration window, enter the following values:For Host Name (or IP address), enter the following command, replacing NetBIOS_NAME, Username, and WorkSpaceIP with the values that you noted in earlier steps. The following is a sample command for using PuTTY:NetBIOS_NAME\Username@WorkSpaceIPFor Port, enter 22For Connection type, choose SSH2.    Choose Open.3.    When prompted, enter the same password that you use when authenticating with the WorkSpaces client. This is your Active Directory password.Note: It's a best practice to use this method only to connect to a WorkSpace for troubleshooting purposes. After you complete your troubleshooting steps, remove the inbound rule that you added.

Related informationAmazon EC2 security groups for Linux instances