EC2 Command Line Tool (Ubuntu)

Install Multiverse Repositories

  • Login to any Ubuntu machine
  • Change to root
    sudo su root
    
  • Add new apt repository in /etc/apt/sources.list
    deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
    deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
    

    Change "lucid" to your selected Ubuntu version

  • Update repository
    apt-get update
    

Install and Configure EC2 Command Line Tool for Ubuntu

  • Login as ubuntu
  • Install the EC2 tools
    sudo apt-get install ec2-api-tools
    sudo apt-get install ec2-ami-tools
    
  • Prepare directory for the key/certificate
    cd /home/ubuntu
    mkdir .ec2
    chmod og-rwx .ec2
    cd .ec2
    
  • Locate the key/certificate in "EC2 Command Line Tool (Window)"
  • Cut and paste the key/certificate information to
    vi pk-aws.pem
    vi cert-aws.pem
    chmod og-r *.pem
    chmod u-w *.pem
    
  • Edit ~/.bashrc
    export EC2_PRIVATE_KEY=~/.ec2/pk-aws.pem
    export EC2_CERT=~/.ec2/cert-aws.pem
    export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/
    
  • Load the configuration
    source ~/.bashrc
    
  • Test EC2 Tool API
    ec2-describe-images -o self -o amazon