How to Set Up Kali Linux on AWS FREE

Ali Gündoğar
5 min readSep 1, 2023

Introduction: In today’s rapidly evolving digital landscape, cybersecurity professionals need versatile and accessible tools to conduct security assessments and penetration testing. One powerful tool in a cybersecurity expert’s arsenal is Kali Linux, a specialized Linux distribution designed for penetration testing and ethical hacking. This article will guide you through the process of setting up Kali Linux in the AWS (Amazon Web Services) cloud environment, providing you with a flexible and robust platform for your security testing needs.

Benefits of Running Kali Linux on AWS

Before diving into the technical aspects of setting up Kali Linux on AWS, let’s explore some of the key benefits of this approach:

1. Cost-Efficiency: AWS offers a free tier that allows you to run Kali Linux without incurring any charges, provided you stay within the free tier limits. This cost-efficiency makes it an attractive option for both learning and professional use.

2. Accessibility: With Kali Linux on AWS, you have the advantage of accessing your instance from anywhere with an internet connection. This ensures flexibility and convenience for security professionals.

3. Always-On Availability: Your Kali Linux instance in the AWS cloud is always on, providing you with a readily available testing environment with a public IP address.

4. Geographical Flexibility: AWS has data centers in various regions worldwide. You can choose to launch your Kali Linux instance in a region that is geographically closer to you, optimizing performance.

5. Secure Access: By setting up a secure SSH tunnel, you can access your Kali Linux instance over VNC (Virtual Network Computing) securely, ensuring that your penetration testing activities remain protected.

Now that we’ve established the advantages of running Kali Linux on AWS, let’s delve into the step-by-step process of setting it up.

Setting Up Kali Linux on AWS: A Step-by-Step Guide

Step 1: Create an AWS Account

To begin your journey of running Kali Linux on AWS, you need to create an AWS account. Follow these steps:

1. Visit the official AWS website to create your free AWS account.
2. Fill in your account details, including your email address, password, and other required information.
3. Select “Personal Account” when prompted to choose your account type.
4. Accept the terms and conditions and provide your credit card information when required.

Step 2: Generate a Virtual Credit Card (Optional)

For added security, you can generate a virtual credit card using services like privacy.com. This virtual card can be linked to your actual debit card, and you can set spending limits on it. This way, you can ensure that your AWS usage stays within the free tier and avoid unexpected charges.

Step 3: Launch Your Kali Linux Instance

Now that you have your AWS account set up, it’s time to create and launch your Kali Linux instance:

1. Log in to your AWS Management Console using your root user credentials.
2. Navigate to the EC2 (Elastic Compute Cloud) dashboard.
3. Click on “Launch Instance” to start the instance creation process.

Step 4: Choose the Kali Linux AMI

In this step, you’ll select the Kali Linux Amazon Machine Image (AMI). Follow these steps:

1. In the EC2 instance creation wizard, select “AWS Marketplace” on the left sidebar.
2. In the search bar, enter “Kali” to find the Kali Linux AMI.
3. Select the Kali Linux AMI, which should be free tier eligible.
4. Click “Continue” to proceed.

Step 5: Choose the Instance Type

Next, you’ll choose the instance type. For this tutorial, select the “t2.micro” instance type, which is eligible for the free tier.

Step 6: Review and Launch

After choosing the instance type, you’ll be directed to the review page. Confirm your selections, and then click “Review and Launch”.

Step 7: Create an SSH Key Pair

To access your Kali Linux instance securely, you’ll need to create an SSH key pair. Follow these steps:

1. If you don’t already have a key pair, select “Create a new key pair” from the drop-down menu.
2. Give your key pair a name, such as “Kali,” and click “Download Key Pair”.
3. Save the downloaded private key (.pem) file in a secure location. Losing this key will result in losing access to your instance.

Step 8: Launch the Instance

With your key pair created, you can now launch your Kali Linux instance. Follow these steps:

1. Review your instance configuration and click “Launch”.
2. In the pop-up window, choose your key pair (e.g., “Kali”) and acknowledge that you have access to the private key.
3. Click “Launch Instances”.

Step 9: Accessing Your Kali Linux Instance

Your Kali Linux instance is now launching. It may take a few moments for it to become available. While you wait, let’s set up secure VNC access.

Step 10: Setting Up Secure VNC Access

To access your Kali Linux instance with a graphical user interface (GUI) over a secure VNC connection, follow these steps:

1. Open your terminal or command prompt.
2. Navigate to the directory where you saved your private key (.pem) file.
3. Use the following SSH command to create a secure tunnel:

ssh -L 5901:localhost:5901 -i Kali.pem kali@<YOUR_INSTANCE_PUBLIC_IP>

Replace `<YOUR_INSTANCE_PUBLIC_IP>` with the public IP address of your AWS instance.

4. When prompted, type “yes” to accept the unknown fingerprint.
5. You are now connected to your Kali Linux instance through SSH. Keep this terminal open.

Step 11: Installing a GUI on Kali Linux

By default, Kali Linux on AWS is command-line-only. If you wish to use a GUI, follow these steps:

1. In your SSH session, run the following command to update your repositories:

sudo apt update

2. Install the necessary packages for the GUI and the TightVNC server:

sudo apt install xfce4 xfce4-goodies tightvncserver

3. Configure the TightVNC server with the desired screen geometry:

tightvncserver :1 -geometry 1024x768

4. Set a VNC password when prompted.

Step 12: Connect to Kali Linux GUI via VNC

With the GUI installed and configured, you can now connect to your Kali Linux instance over VNC securely. Here’s how:

  1. Download and install a VNC viewer like VNC Viewer.
  2. Open your VNC viewer and connect to the following address:

localhost:5901

3. Enter the VNC with password you set earlier.
4. You should now have access to the Kali Linux GUI running on your AWS instance.

Conclusion

In this comprehensive guide, we’ve walked through the process of setting up Kali Linux on AWS for penetration testing and ethical hacking purposes. By following these steps, you can leverage the power and accessibility of AWS to run your Kali Linux instance in the cloud securely. Remember to use this environment responsibly and within legal boundaries.

By combining the flexibility of AWS with the robust capabilities of Kali Linux, you’re well-equipped to enhance your cybersecurity skills and conduct effective security assessments.

Stay secure, stay ethical, and happy hacking!

References

1. [AWS | Kali Linux Documentation](https://www.kali.org/docs/cloud/aws/)
2. [Installing Kali Linux on Cloud — Amazon AWS](https://subscription.packtpub.com/book/security/9781783982165/1/ch01lvl1sec10/installing-kali-linux-on-cloud-amazon-aws)
3. [Kali linux and penetration testing using AWS — Medium](https://medium.com/@venkatramshesh/kali-linux-and-penetration-testing-using-aws-d63b5bb456bb)
4. [Configuring Kali Linux on Amazon AWS Cloud for FREE](https://cybersecurity.att.com/blogs/security-essentials/configuring-kali-linux-on-amazon-aws-cloud-for-free)
5. [Getting Started with AWS and Kali Linux — Greatheart](https://www.greatheart.io/post/getting-started-with-aws-and-kali-linux)
6. [Install Browser Based Kali Linux on AWS Cloud — Techlatest.net](https://www.techlatest.net/support/kali_linux_browser_support/aws_gettingstartedguide/index.html)
7. [Kali Linux in the cloud using AWS — DevPress— CSDN](https://devpress.csdn.net/linux/62ea30e66484667128339c77.html)
8. [Installing Kali Linux on AWS (Amazon Web Services)](https://www.kalilinux.in/2020/01/installing-kali-linux-on-aws-install-kali-on-cloud.html)

--

--

No responses yet