Amazon Web Services – Connecting to your Windows Instance

Connecting to a Windows AMI

There is a free instance of Microsoft Server 2008 R2 that you can launch, but connecting to it is quite different than connecting to Linux. You can start up your windows instance much like your Linux instance, as shown below. You select your instance, name it, and create your key pair for it, just like you did with Linux.

AWS - Windows Server 2008 R2 Instance
Starting up your AWS Windows Server 2008 R2 instance

Since there is quite a bit more “stuff” that needs to happen to get your windows system up and running, it will take a few minutes before we can actually connect to the instance. Go get some coffee or visit the restroom because you have some time right now. Basically the system has to go through sysprep in order to become a unique instance from the machine image we started it from… it takes time… so be patient. When your instance view shows the instance running and 2/2 checks are green, you are ready to connect.

AWS - Windows Server 2008 R2 ready to connect
Windows Server 2008 R2 ready to connect

Same as before, right-click on your instance and select “Connect”. This time, however, the dialog that appears will be slightly different from the Linux one as you can see below. This is because we won’t be using SSH to connect to Windows… we’ll be using RDP which requires a username and password.

AWS - Connecting to Windows Server 2008 R2
Connection dialog when connecting to Windows Server 2008 R2

The first thing we need to do here is retrieve your password (which is based on your Key Pair). So click on the Retrieve Password Link, which will take you to the screen below.

AWS - Retrieve Password
Retrieve your Windows Server 2008 R2 password

Unlike in Linux, we can actually browse to where we have the Key Pair file stored. In this example, we named our key pair Svr2008R2.pem. So click browse and locate your Key Pair file. Once you have it selected you will then see the option to decrypt your password.

AWS - Now Decrypt your Windows Server 2008 R2 password
Now Decrypt your Windows Server 2008 R2 password

Once you have selected “Decrypt Password” your dialog window will update with your credentials. Note them down and click “Download shortcut file”, which will allow you to save the basic connection information in a RDP shortcut on your local computer.

AWS - decrypt your Windows Server 2008 R2 password
Decrypt your Windows Server 2008 R2 password

When you click on download, you’ll be prompted for a file name… by default it’ll be your Machine name, which isn’t too intuitive. So type in something you’ll remember.

AWS - Save your RDP info
Save your RDP information.
AWS - Name your RDP shortcut something you'll remember
Name your RDP shortcut something you’ll remember

I simply saved the shortcut to my desktop, and when I launch it (from my MAC) I get the following connection screen (Even if you’re running windows, it will be similar)

AWS - RDP to Amazon INstance
RDP to Amazon Instance

When you click Connect, you will be prompted for your Username and Password. This is the password we just generated. You will not enter anything for Domain.

AWS - RDP - logging in
AWS – RDP – logging in

You will be prompted that the server name on the certificate is incorrect, simply click OK to continue to log into your instance.

AWS - Server Certificate Warning
Server Certificate Warning

Once you click Connect you are on your way to your desktop.

AWS - Windows Server 2008 R2 Desktop
Windows Server 2008 R2 Desktop

Since this is a micro instance, don’t expect this environment to be speedy. But if you are looking for a R2 server to beat up, mess around in, test your admin skills on, etc… this is the way to do it. By sticking with the micro instance you can run this sever 24/7 for one full year at no cost to you. Remember that if you spin up 2 or more you will begin chewing up your 750 hours/month more quickly than if you had just one. Also with windows, disk space can be an issue. Monitor it and make sure you a) don’t run out of space or b) allocate yourself more space because the former will cost you clean up time and the latter will cost you money.

Terminating your Windows Server 2008 R2 Instance

Remember, if you instance is running you are “On the Amazon clock”. Shutdown your server when you’re not using it. If you have been experimenting and gotten to a place where your instance is useless, just terminate it. As we did with the Linux instance, just right-click on your instance from your Instance View and select “Terminate”.

AWS - Terminating your Windows Instance
Terminating your Windows Instance

Be sure to delete your associated EBS volumes (off-instance storage). If you don’t you may end up being charged for using the space.

That’s It!

So now you know how to connect to a Windows free micro instance on Amazon Web Services. Here’s the thing to keep in mind… these are sandboxes for you. You can create, destroy, terminate anything you want as many times as you want so you can learn what you want to learn when you wan to learn it. With the micro instances you have 750 hours of free usage per month for one year. Make the most of that year. Experiment, create, try, fail, try again… and come out the other side knowing more than you did when you went in.

Best of luck and let me know if you have any questions!

PS – I have already terminated all the instance that have been used in these posts. That’s why I haven’t obscured anything in the images. You get to see what I saw when I spun them up so you get a feel for what you expect to see… but don’t waste your time trying to hack into any of these instances… they’re gone… long gone.

 

Enhanced by Zemanta

Amazon Web Services – Connecting to your Linux Instance

We have already launched a free instance of an Amazon AMI in our last post. Now we’ll look at the ways you’ll connect to your Linux instance.  This will be a lengthy post, mainly due to the fact that there will be a lot of “showing” along the way.

Connecting to a Linux AMI – Securely

SSH Key Pairs

In the last post I didn’t go into how to create a key pair.  You’ll need one in order to connect to any instance, so we’ll quickly create one now while we spin up a new Linux instance (just as we did in our last post).  Be sure to select one of the available free instances. For this post we will again use the Amazon AMI. When you select the instance you will be spinning up, you can create a new key pair as shown below.

AWS - Create Key Pair
Creating your Key Pair

All you need to do is name your key pair, and then you’ll be able to download it by clicking the download button.

AWS - Downloading your Key Pair
Filling in your Key Pair information to download your Key Pair.

Remember where you save your file (it will have a “pem” extension).  So in the example above you will download GettingConnectedLinux.pem to your local computer.  Don’t share this file with anyone or post it on the net anywhere.  It’s your security key into your environment.  If you make it public, your environment is now public… so keep it safe. Amazon describes your key pair as follows:

Public AMI instances have no password, and you need a public/private key pair to log in to them. The public key half of this pair is embedded in your instance, allowing you to use the private key to log in securely without a password. After you create your own AMIs, you can choose other mechanisms to securely log in to your new instances.

So now you have a key associated to an instance that you have spun up.  Now we can work on getting connected.

Connecting to your instance

Confirm your instance is up and running.  Navigate to your Instances menu so we can see what instances are running

AWS - Navigate to your instance
Navigate to your instance view

You should now see your running instance.  In our example we called our Amazon AMI “GettingConnectedLinux”.

AWS - Running Instance
Confirm your instance is running

Now right-click on your running instance and you will get a sub menu.  We are looking for “Connect” at the top of that sub menu.

AWS - Get Connected
Getting connected to your Linux instance

You’ll get a new dialog that will open.  We will be connecting from our browser using the Java SSH client.  You can set up your own connection using your own SSH client, but for this example we’ll be using the Java SSH client.

AWS - Connection Dialog
Connection Dialog box for Linux

Here’s where we need that key pair file.  There is no browse option here… you need to type in the exact path & file name of your key pair file.

AWS - Completed Connection Dialog
Completed Connection Dialog.

When the path and file name are complete you can click “Launch SSH Client”.    This will begin the process of connecting to your instance.  You will be prompted to add this host to your known hosts if you like.  It’s not required.  If all goes well, you’ll see a terminal window that is now connected to your instance.

AWS - Connected to your Amazon Instance
Terminal windows indicating successful connection to your instance.

If you know your way around Linux…. you’re all set.  You are connected and able to do whatever you like to this instance.  You can install packages, configure it as a web server, do anything you like to it.  Just remember though, Amazon is tracking the usage.  You get 750 hours a month of free usage if you are using a free tier eligible AMI.  If you get crazy and spin up 2-3 free tier AMI’s you are chewing up an hour of time for each instance.  If you go over the 750 hours you will be charged.  So, while you’re playing, keep it to one running instance at a time.

Cleaning Up

When you are done having fun you’ll want to disconnect from your instance.  If you are completely done with your instance, you may want to permanently terminate it.  To do this, first disconnect from your instance.  Simply select the File menu, then Exit.

AWS - Disconnect from your Instance
Disconnect from your Linux instance.

If you are going to connect again later, you can keep your instance running.  If you want to keep the state of your instance, but don’t want it running any longer, you can stop your instance.  If you are done with this instance and want to permanently delete it, you can terminate it.  To terminate your instance you can right-click on your instance (as we did when we connected to it) and select terminate.

AWS - Terminate your instance
Terminate your AWS instance

Remember, this is a permanent action.  If you have work you want saved, select “Stop”, not “Terminate”.  Once you have you have terminated your instance, you’ll see that reflected in the status of your instance view.

AWS - Terminated Instance
Instance View showing terminated instance

This status will stay in your view for a while, but will eventually be cleared from your dashboard completely.

That’s It!

So now you know how to connect to a Linux free micro instance on Amazon Web Services.  Here’s the thing to keep in mind… these are sandboxes for you.  You can create, destroy, terminate anything you want as many times as you want so you can learn what you want to learn when you want to learn it.  With the micro instances you have 750 hours of free usage per month for one year.  Make the most of that year.  Experiment, create, try, fail, try again… and come out the other side knowing more than you did when you went in.

Best of luck and let me know if you have any questions!

PS – I have already terminated all the instances that have been used in this post.  That’s why I haven’t obscured anything in the images.  You get to see what I saw when I spun them up so you get a feel for what you expect to see… but don’t waste your time trying to hack into any of these instances… they’re gone… long gone.

 

Enhanced by Zemanta

Amazon Web Services – Getting Started

Hopefully you have already signed up for your Amazon Web Services (AWS) account. It’s simple & straight forward so I won’t be going over that here.

Once you are signed in, you will go to your control panel, shown below.

AWS Full Console
Amazon Web Services console showing all your available AWS options.

Once you can see this screen you are on your way to playing in the cloud.  For this post we will concentrate on EC2 and spinning up an instance.  It’s short & sweet and easy to accomplish. Click on the EC2 link to go into the EC2 console.  It will be from here that we will be launching virtual machines (AWS refers to them as instances).  Clicking on the link will take you to the EC2 specific console.It will take no more than 10 minutes from here to get your first virtual server up and running. As you can see in the screen below, the yellow highlighted area is our starting point.

EC2 Console
EC2 Console

Click on “Launch Instance”.  This will take you to another view that will allow you to choose the type of machine you want to deploy.  You can upload your own virtual machines that can be deployed on EC2, but aren’t covering that in this post.

Selecting your instance (AWS AMI)
Selecting your instance (AWS AMI)

There are 4 items to make note of here:

  1. Naming your instance.  This is actually optional, but a good practice none the less.  Just type in a name that you want to use for your own benefit.
  2. Key Pair.  Since I am assuming this is your first time in, you don’t have a key pair established yet.  You need one in order to later connect to your instance.  So, select “Create New” in order to create your key pair file.  Amazon’s documentation on key pairs can be found here.  In general you want to:
    • Open the Amazon EC2 console
    • Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/
      Click Key Pairs in the Navigation pane.
    • The console displays a list of key pairs associated with your account.
      Click Create Key Pair.
    • The Key Pair dialog box appears.
      Enter a name for the new key pair in the Key Pair Name field and click Create.
    • You are prompted to download the key file.
      Download the key file and keep it in a safe place. You will need it to access any instances that you launch with this key pair.
  3. Choose the AMI you will be launching.  AMI = Amazon Machine Instance and is how Amazon refers to the virtual machines it provides to its customers. You can choose any AMI you’d like… but I’d stay in the free tier of service by selecting one that is starred & noted as “free tier eligible”.  For this post I’m selecting the Amazon Linux AMI (which I believe is a Debian Linux distribution).  It has a lot of the basics contained within it and it’s easy to add-on to if you want.
  4. Once you have items 1-3 take care of, click “Continue” to start the process of launching your instance (virtual server).

You will be prompted with another screen after clicking “Continue”.

Launching an Amazon AMI
Launching an Amazon AMI

For this post, we’ll just click “Launch” at this point and get the instance running.

AWS Instance starting
AWS Instance starting

You can close this screen.  The instance will spin up quite quickly (if you chose a Windows instance it’ll take longer).  You can now see your instance details by clicking on the left menu, selecting “Instances”.

Selecting your Instance View
Selecting your Instance View

 

Now there’s plenty more we can do here… but I think that’s plenty for “Getting Started”.  In the next post we’ll connect to the running server and do a few basic checks.  I’ll be running Linux again… so be prepared for a prompt based view.  I may do a separate post on running a Windows instance since you’d use SSH to connect to Linux and RDP to connect to Windows.

Get your free micro instance running and we’ll get connected to it in the next post.  Let me know your thoughts/comments/questions and I’ll do what I can to help you out.

Until next time…

 

 

Enhanced by Zemanta