# Day 22 : Configuring Secure SSH Access to an EC2 Instance

Welcome back to Day 22. In this lab, you will learn how to set up secure SSH access to an EC2 instance without using a password. You need to create an EC2 instance and name it **nautilus-ec2**. Then, generate an SSH key on the **aws-client** host.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766405748871/083b4e7a-e207-4a8f-9d51-72e604f2152e.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766405778093/68c4b0f5-dacd-46c8-bae2-8d60bd957514.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766405803367/1fa05259-601e-418c-9dbd-08d424aa39e6.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766405922068/88d0728a-6cc0-459b-9fcd-cd20a3cc777a.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766405968960/d576d68f-4a8b-4d11-9a12-a836c5f59246.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766406653033/407ea583-9522-465c-8f58-348f242e3c51.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766406686658/a7b3244a-d1c2-4a0a-9673-c2802e21d1f2.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766406749140/30576090-1dce-4bbb-b287-ade8f46fdecb.png align="center")

After setting up an EC2 instance, generate an SSH key using the **ssh-keygen** command. You need to upload your **id\_rsa.pub** key file to the EC2 instance's root SSH **authorized\_keys**.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766406467589/b5f5731d-e977-433a-8a50-b547df4c685e.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766407162195/8c31bdb6-12bc-48a3-88bf-f886dab4aa42.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766407218470/fce5cbce-92a2-4967-808f-64c0ca5f95e1.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766407250709/04097312-bfb8-4f46-b41f-f0b120964247.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766407313265/40536ba6-86f2-466a-9b9f-ae38f9118ce3.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766407328974/7d78f340-fd2b-4f89-adc9-ede92599d408.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1766407351422/b91072cc-f7c3-4b4a-8b9c-2442536c2c05.png align="center")

Congratulations you did it. It looks good. This lab was successfully completed without any errors. See you in day 23. If you have any issues please let me know I will be happy to assist you. Stay tuned and learn together. If you find my article useful, please kindly like and share it.
