Showing posts with label Amazon Access Key. Show all posts
Showing posts with label Amazon Access Key. Show all posts

Thursday, December 15, 2011

Add a new user to Amazon EC2 instance

After connecting to your Amazon EC2 instance, you can add a new user with sudo privilege with following steps:
  1. Open a putty session, log in with the default user, ec2-user
  2. sudo su
  3. useradd new_user_name
  4. passwd new_user_name, give a password for the new user
  5. vim /etc/sudoers, insert line "new_user_name ALL = NOPASSWD: ALL" at the end of the file
  6. cd /home/new_user_name
  7. mkdir .ssh
  8. cp ../ec2-user/.ssh/authorized_keys .ssh/authorized_keys
  9. chown -R new_user_name:new_user_name .ssh
  10. chmod 700 .ssh
  11. chmod 600 .ssh/*
Open another putty session and log in with the same private key you use for ec2-user.

Sunday, December 11, 2011

Amazon Elastic Compute Cloud (EC2) : Part 3: Launch An Instance

In Part 1 and Part 2, I talked about creating an Amazon AWS account and setting up access credentials. In this part, I will talk about launching an instance.



  • If you don't have any key pairs, you can click the Key Pair link under My Resources section to create a key pair.

  • Click the Create Key Pair tab.


  • Enter a Key Pair Name and click Create. Save the generated private key to your computer. After a key pair is created, go back to the EC2 Console Dashboard. Click the Launch Instance Button to start an EC2 instance.

  • From the Request Instances Wizard, you can choose an Amazon Machine Image that meets your needs.  I'll choose the first one, Basic 32-bit Amazon Linux AMI 2011.09.


  • Choose an Instance Type (I choose Micro here), and click Continue. In next screen, use all default values and click Continue.

  • Add tags to your instance and click Continue. I use Name for the Key and my_demo for the Value.

  • Pick up an existing Key Pair or create a new one for connecting to your instance if it launches.


  • Configure Firewall: You can use an existing security group or create an new one. I'm going to create a group here. Click Create a new Security Group radio button, enter a name. Pick up a rule from Create a new rule dropdown box and click Add Rule button. You can define as many rules as you want.
  • Final Review. Everything looks good. Click Launch.

Congratulations, Your first Amazon EC2 instance is up and running!  I will talk about connecting to Amazon EC2 instance in part 4.

Thursday, December 8, 2011

Amazon Elastic Compute Cloud (EC2) : Part 2: Create Access Credentials

You have created an Amazon AWS account (See part 1 for account creation instruction), now let's create access credentials.
Log into your Amazon AWS account, click the Security Credentials On the left Panel. Amazon automatically creates one access key for you when you sign up for an account.

Access Keys screenshot
Let's create X.509 certificates. Go to the X.509 certificates tab and click the link – ‘Create a new certificate’. A private key and an X.509 certificate will be generated for you. Remember to download at least your private key before you close the page. You can rename the file name of download keys to something easy to remember.


Now you have created the X.509 certificates. The final piece you need is Amazon EC2 Key Pairs for launching an Amazon EC2 instance. Click the Key Pairs tab, then the Create a New Key Pair link. Save the private key(rename it if you want). Also download the public key.

Let review what you have so far:
  • AWS account ID
  • Access key ID

  • Secret Access KEY
  • X.509 certificate file (.pem file)
  • X.509 private key file (.pem file you saved to your computer)
  • CloudFront public key file (.pem file)
  • CloudFront private key file (.pem file)
Congratulations, you have completed the setup of your Amazon AWS! In Part 3 I will talk about how to launch an instance and access it from your computer.