Try the following steps:
Step1: Open up the AWS console and navigate to your EC2 dashboard
Step2: Select the region and then go on security groups
Note: The selected region should be the same where you have launched your Elastic Beanstalk instance.
Step3: In security groups, select the security group named as elasticbeanstalk-default
Step4: Add a rule for SSH in elasticbeanstalk-default security group as shown below:
SSH | tcp | 22 | 22 | 198.168.1.1/32
Step 5:Create a key pair if you haven't created one yet
Step 6: Navigate to the Elastic Beanstalk tab in your AWS console
Step 7: Go to configurations in left pane
Step 8: click on Security
Step 9: Select the name of your key pair in EC2 key pair field
Step 10: Re-launch the instance, once relaunched, you need to get the host name from your EC2 dashboard and then SSH onto the server using the following command:
$ ssh -i path/to/keypair.pub [email protected]