# How to CloudShell SSH in to ec2 Instances

Previously you would have to use PuTTy or some other terminal emulator to log in to EC2 instances but now CloudShell offers a fresh option.&#x20;

When creating the EC2 instance, make sure to allow your IP address in the security groups as well. To be able to SSH you will need to create a key pair and ensure to get the .pem key

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FGViVDjg4nuLql0qfAxgU%2Fimage.png?alt=media&#x26;token=34c69d2d-8cd3-4c87-a45c-ed2b2a41cd79" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2F0oFUPDF2TEOTIdYndGJI%2Fimage.png?alt=media&#x26;token=5d868301-d949-417a-bdcc-8778109ca6c2" alt=""><figcaption></figcaption></figure>

Once the instance is created, you can highlight it and select the connect option

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2Ffp5JIOfkUK57sykFy2EE%2Fimage.png?alt=media&#x26;token=214a4afa-fc71-4808-b969-088615983f34" alt=""><figcaption></figcaption></figure>

To access Cloudshell it can either be typed in the search bar or selected in the top right

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FM315HKup6osTA3SNioNV%2Fimage.png?alt=media&#x26;token=80fa0c8f-7155-4f2b-b209-1f9a52a4e4c7" alt=""><figcaption></figcaption></figure>

I’ve downloaded my pem file so I will be using the upload option

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2F2DqC0t2pKkpdLgePJOsD%2Fimage.png?alt=media&#x26;token=4132ec3e-fc4a-4c24-9043-97e1a5716501" alt=""><figcaption></figcaption></figure>

Confirming the file has been uploaded

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FfDzm7O4KFAqmETGwPIle%2Fimage.png?alt=media&#x26;token=6e510375-1419-41eb-9f6d-81917ec6c9aa" alt=""><figcaption></figcaption></figure>

Now I am in

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FFkuEV3VcWtSdbc9DxQay%2Fimage.png?alt=media&#x26;token=983bbc89-ff3f-49d1-92fe-841b1413daf3" alt=""><figcaption></figcaption></figure>

Success!\
\
Connection was previously refusing because of some IP issues which I managed to fix.
