AWS Access Key and Secret Access Key (SIMPLIFIED)

There are two ways to access AWS environments.
1) Console Access
2) Programmatic Access

1) Console Access is when you access to AWS portal with your username and password. The GUI interface

2) In Programmatic Access, you are accessing AWS resources using Command lines, Powershell or SDKs.


-> With Programmatic Access, you are accessing using Access Key ID and Secret Access Keys.

Access Key ID and Secret Access Keys are different from your username and password.


When you create your first AWS account, Access Key ID and Secret Access Keys are also created.

It is important to secure or disable them, and not share these Access Key ID and Secret Access Keys otherwise this will give you the root access to your AWS account.

The best practice would be to create a new user and give specific permissions rather than using the root account.

AWS STS Security Token Service is another way to create a temporary, Limited-privileges credentials to IAM users.


To Disable Access Key, navigate to Identity and Access Management (IAM) under Services. > Manage Access Keys.

Disabling this is one way to secure the account, if programmatic access is not required.

Teza

Unprotected Private Key File

Warning: Permanently added '192.168.1.1' (RSA) to the list of known hosts.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/path/to/my/key.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /path/to/my/key.pem
Permission denied (publickey).

It’s a common error to see when trying to log in to a server via SSH, and it has a relatively easy fix. But before we get to that, let’s get some background on why this error shows up.

Why am I seeing this Error?

What happened is the key you’re trying to use (key.pem in the example above) is too accessible to users on the system.

This is a bad thing because then you’re not the only one able to use the key, which defeats the purpose. Private keys should only be accessible to one user.

For example, if an attacker somehow gains access to any of the accounts on your system, then they’d be able access the key, as opposed to having to get access to your account specifically. This gives them too many opportunities to get to the private key.

How can I fix it?

Like I said earlier, this is an easy fix. Just run:

$ sudo chmod 600 /path/to/my/key.pem

Or if you are running gui, locate the pem file, right click and change the permissions as per below.

That should do the job.

Terraform walk through with AWS creating S3 buckets

Terraform is a IaaC tool developed by Hashicorp. It can be used with multiple platforms like AWS, Microsoft Azure, GCP and provision different environments.

Running Terraform is simple, you simply need to install Terraform first on the host you intend to run, whether it be local, remote or cloud hosts. Move to desired location /usr/local/bin. Then create a Terraform config file – which is written in HCL (Hashicorp Config Language) that ends with .tf extension.
Using simple commands like Terraform init, plan, apply, destroy, you can manage and provision infrastructure safely and efficiently.

See my Video tutorial on setting up Terraform on AWS EC2 instance.

My Video Tutorials

Here are some Azure tutorials that I have created.
The reason why I create video tutorial is because I can help others while I am improving myself learning.
To create a tutorial, I need to know every single details about my topic. Therefore I got to prepare more and learn more by creating these tutorials.

These contents are free for educational non-profit purposes. I have put time and effort to create these tutorials.
If you push a subscribe button on my channel, I would be much appreciated and this will also encourage me to create more tutorial videos. Thanks.

My Youtube Channel below –
https://www.youtube.com/channel/UC-w05D5NxOcfogVG2-VlHtQ/videos

 

IaaC and my weapons of choice

With Infrastructure as a Code IaaC, you can manage any infrastructure such as Network, Servers, Storage and Applications. There are many common IaC tools. Although you can use any combination of these tools to create similar solutions, these are strength in each tools and these are my preferences to achieve different goals.

Image Templates
You need image templates to create custom images of a Virtual Image or Container.
Then you will need software and dependencies installed on it. My weapon of Choice – Docker

Configuration Management
Ansible – the strength of this tool is that it is Idempotent. There is Ansible Playbook will which will check with repository. You can run the code multiple times and every time you run the code, it will only make changes to the difference and bring the code to defined state.

Provisioning Tools
Terraform – This Hashicorp tool supports almost every infrastructure and it can be set up on many platforms, AWS, VMware, Azure, you name it.

Cloud Formation – simply because it is AWS proprietary. If your job has alot to do with AWS, Cloud Formation is the way to go.

Teza

Apply for $300 AWS Credit with AWS Proof of Concept Program

Yes Amazon is giving away $300 credit with Proof of Concept Program.
Read on below from AWS and see if you are eligible for the application.

Amazon Web Services wants to help your business scale and grow with low cost, easy to use cloud products and services.  The AWS Proof of Concept Program provides a $300 credit to small businesses to quickly get started and test AWS against their specific IT and business requirements by subsidizing a proof of concept. More than a million active customers, from Slack to GE, use AWS Cloud solutions to deliver flexibility, scalability, and reliability. Join them and start scaling your business with AWS today.

To qualify, you must have:

  • A valid AWS account, with up-to-date billing information 
    (reseller accounts do not qualify)
  • Not previously received more than $200 of AWS promotional credit
  • A sufficient business case and proof of concept to test using the credits
  • No linked accounts
  • Credits valid for 6 months

Cannot Delete S3 Buckets using Root Access

Lately, I have been doing some testings with AWS Elastic Beanstalk and came across this issue where I could not delete the S3 bucket even with my root account.

It comes up with the message saying

"Insufficient permissions to delete bucketAfter you or your AWS admin have updated your IAM permissions to allow s3:DeleteBucket, choose delete bucket"

The solution is to change the bucket policy.

Continue reading “Cannot Delete S3 Buckets using Root Access”

Launching EC2 Instances on AWS

After reviewing my video, when i was first accessing my DB instance from my local server, I could not access and the reason was because of the internal IP. 😛 what was I thinking, anyways its just a demo video so I hope you can forgive me with that.

Anyways, more video tutorials to come. Please like and subscribe. That will motivate me to create more videos. Cheers

Continue reading “Launching EC2 Instances on AWS”

AWS Virtual Private Cloud Setup

This is my Video tutorial on how to manually set up Virtual Private Cloud VPC on Amazon AWS.
This will include setting up, VPCs, Subnets, Internet Gateways, Security Policy etc.

If you like this video and want more contents like this, please like and subscribe.
Why not! Its just one simple click and you will not lose anything!

Continue reading “AWS Virtual Private Cloud Setup”

No Package MYSQL Server Available

If you have come across an issue of installing sql server on AWS Linux AMIs, especially when you are using one of those Free Tier Eligible AMIs, well its very likely that this is the solution for you. I came across this issue and got me stuck for a little while before I found the solution somewhere on the net. The problem is that the AMIs that you are using may not have the default repos in it.

Continue reading “No Package MYSQL Server Available”