Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download the AWS CLI:

    Code Block
    languagebash
    curl "<httpshttps://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip>zip" -o "awscliv2.zip"
  2. Install unzip tool (if not already installed):

    Code Block
    languagebash
    sudo apt update
    sudo apt install unzip -y
  3. Unzip the downloaded AWS CLI file:

    Code Block
    languagebash
    unzip awscliv2.zip
  4. Install AWS CLI:

    Code Block
    languagebash
    sudo ./aws/install
  5. Verify installation:

    Code Block
    languagebash
    aws --version

    You should see the installed version, such as: aws-cli/2.x.x

...

  1. Download the latest stable version of kubectl:

    Code Block
    languagebash
    curl -LO "<httpshttps://dl.k8s.io/release/$(curl>curl -L -s <httpshttps://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl>kubectl"
  2. Install kubectl:

    Code Block
    languagebash
    sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
  3. Verify kubectl installation:

    Code Block
    languagebash
    kubectl version --client

    You should see the client version information.

Step

...

6: Create Ubuntu users

Create the ubuntu users with the same username as IAM user & provide necessary privileges.

Code Block
languagebash
sudo useradd -m -s /bin/bash <username>  # creates a new user

sudo visudo                          # edit sudoer file add below line to it, to restict
<username> ALL=(ALL) NOPASSWD: !ALL  # password prompt when accessing sudo from other users

sudo mkdir /home/<username>/.ssh
sudo vi /home/<username>/.ssh/authorized_keys  # add user's public key

sudo su - <username>

Login to the user created and proceed

Step 7: (Optional) Configure AWS CLI

To configure AWS CLI with your credentials and default settings, run the following command:

...

  • AWS Access Key ID

  • AWS Secret Access Key

  • Default Region Name (e.g., ap-south-1)

  • Default Output Format (e.g., json)

Step

...

8: Harden Security

  1. Limit SSH Access:

    • Consider restricting port 22 access to specific trusted IP addresses for enhanced security, instead of allowing open access (0.0.0.0/0).

  2. Install Security Updates:

    • Update all packages on the instance to the latest security patches:

      Code Block
      languagebash
      sudo apt update && sudo apt upgrade -y

...