4

I am a little confused here. I created a Amazon EC2 instance with Ubuntu Linux 64-bit 12.04 LTS, now when I SSH into it I get the following

enter image description here

but on Amazon Management console I get the following

enter image description here

What is wrong here?

2 Answers2

4

Ignore the web-based management console and believe the welcome message.. You are running AMI Linux which is NOT based on Debian/Ubuntu but on CentOS (which in turn is based on RedHat). The default package-management tool is yum, not apt, as these release notes make clear.

Consider installing one of the official Ubuntu AMIs from Canonical, available here:

http://uec-images.ubuntu.com/releases/precise/

Note: The reason for such problem may be use are using old EBS containing Amazon AMI.

ish
  • 139,926
  • +1, thanks, does that mean there are several version (images) of Ubuntu and they are different from each other. – Gaurav Agarwal Aug 13 '12 at 13:57
  • Well, there's the desktop/server variants of all the releases (10.04, ... 12.04, etc.), and within the current/newer ones they release every 1-1.5 months so you don't have to spend all your bandwidth on updates (even a daily version I believe). As 12.04 is an LTS (stable), I'd just go with the latest and start doing stuff! :) – ish Aug 13 '12 at 14:05
  • ok, I launched ami-8a7f3ed8 from the link you suggested but again my SSH window shows Amazon Linux AMI. – Gaurav Agarwal Aug 13 '12 at 17:35
  • If this is a paid instance I'd contact Amazon Support if I were you... – ish Aug 13 '12 at 17:36
  • Could it be because the EBS I am using as root volume is the one which had Amazon Linux AMI and an I am reattaching it to Ubuntu AMI. – Gaurav Agarwal Aug 13 '12 at 17:48
  • @codingcrow: yes! that probably explains it. No matter what you choose in the console, your root volume boot up Amazon Linux AMI because that's the only thing it contains...can you wipe it or create another EBS? – ish Aug 13 '12 at 17:55
  • I am trying launch a fresh instance to confirm. But I have tomcat and mysql on that volume which I don't want to loose any help!! – Gaurav Agarwal Aug 13 '12 at 17:57
  • If you want to run tomcat and mysql and they were installed on Amazon Linux AMI, you'll have to stick with that as your OS. If you simply want to transfer the data/DBs, you should be able to move it between the EBS...I think. – ish Aug 13 '12 at 17:59
  • Ok, that explains it, if you could please add this your answer. I will accept it. – Gaurav Agarwal Aug 13 '12 at 18:16
3

ami-acf6b0fe is indeed an official Ubuntu 12.04 LTS Precise AMI in Amazon EC2's ap-southeast-1 (Singapore) region.

The welcome message you list is indeed for Amazon Linux.

This means that the EC2 instance listed in your AWS console is not the EC2 instance you are connecting to with ssh.

You should double check IP addresses, hostnames, instance ids, AWS accounts, and EC2 regions.

Eric Hammond
  • 1,173
  • Hi Eric, I deleted the AMI and launched a new Ubuntu 12.04 LTs from Canonical ami-8a7f3ed8, but I still have same "Amazon Linux AMI" as shown in the image. I have checked the IP address mention in SSH is my IP address. AWS account is mine. EC2 region is correct. What do you want me to check in hostnames? – Gaurav Agarwal Aug 13 '12 at 17:34
  • 1
    @codingcrow: No. If you start an instance of ami-acf6b0fe or ami-8a7f3ed8 in ap-southeast-1, then you can only connect using ubuntu@ and it will show the standard Ubuntu greeting on login. You need to ssh to the correct IP address for the instance you are starting. TIP: Once you terminate the instance, you should no longer be able to ssh to it. – Eric Hammond Aug 14 '12 at 01:07