The Linux Cloud on AWS: use Linux skills to power cloud deployments

Why the Linux Cloud is a really big deal and what you have to know to start taking full advantage of it.

The fact is, since they probably constitute only around 2% of the total consumer PC market, you may not see all that many desktop and laptop machines running Linux. But the connected infrastructure holding the Internet together is a different matter altogether.
If you’re running a server, mainframe, supercomputer, embedded system, gaming console, network router, and (through Android) smart phones, then the odds are overwhelming that you’re working with Linux. And Cloud Computing? Let’s just call it the Linux Cloud.
As of last year, Google was said to regularly launch over two billion virtual Linux containers per week. Even Microsoft’s Azure will now host Linux instances. But the undisputed market leader in the Cloud Computing market is AWS and, at least as of late last year, 74% of all AWS instances were reportedly powered by Linux.
“Linux cloud” machines are generally cheaper to run, quicker to scale and, for all intents and purposes, better documented than the competition. All this means that Linux cloud deployments are only going to become more common. If you’re out to get things done in the cloud, this is one train you really don’t want to miss.
Cloud Academy has now published the first five courses in our LPIC Server Professional Linux certification series. These five courses cover all the material needed to take and pass the LPIC-1 101 exam. (The remaining courses aimed at the second exam, should appear over the next weeks.) If you want to really understand how Linux systems – the backbone of the Internet – work, consider taking these courses.
But in the meantime, here are some basic, must-have concepts and skills that will at least get you started with Linux instances on AWS.

Optimized “Linux Cloud” distributions

The AWS Marketplace (when accessed through the EC2 Launch Instance process), offers all kinds of pre-built Linux images, mostly available for free. While there are many very specialized images (like the OpenVPN image, for example), the two most popular general choices are probably Amazon Linux and Ubuntu Server. Both of these images are specially optimized Linux cloud distributions, and were built with AWS very much in mind.
Whether either one of these has a clear performance advantage over the other will probably depend on your specific needs. Amazon Linux – which is based on the CentOS distribution – is obviously deeply integrated with the larger AWS infrastructure and comes with Amazon Tools installed by default. On the other hand, Ubuntu, since it uses the Debian repositories, will have native access to a staggering range of installable software.
One consideration is Amazon Linux’s approach to updates. Since the 2011.09 release, Amazon Linux images are all automatically updated to the most current version available. Most of the time, this works well. However, there may be scenarios where an unexpected update could break an important configuration. If you’re concerned about this, pass this user data to your instance upon launch:

repo_releasever: 2014.03

Administrative Permissions

Since just about everything that happens on a Linux system starts with a plain text file of some sort or another, controlling the permissions for sensitive system files and directories is critically important. For our purposes, read, write, and/or execution access to each file and directory is defined for its owner, group, and/or others. If you need to edit or create files for which you don’t normally have rights, most Linux distributions allow you to temporarily assume admin powers by prefacing your command with sudo (and, when prompted, providing your password), like this:

# Install the Apache web server from a repository:
$ sudo yum install httpd

But that assumes that your user account is allowed to invoke sudo. For that to be true, your user would have to be part of an admin group. Many Linux distributions (Red Hat, Fedora, etc.) assign root privileges to all members of the wheel group. Practically, this is done by adding the wheel group (and therefore, its members) to the sudoers file (/etc/sudoers). Debian and Ubuntu do effectively the same thing, but they call the group “sudo” instead of wheel.
By default, the wheel group on an Amazon Linux machine is not included in the sudoers file, although accessing the instance through SSH using a valid AWS keypair will give you full administration rights, and full access to specific services using the SDK or other tools can be opened up through IAM policies. Should your specific needs require enabling root access for the wheel (or sudo) group, AWS documents the process.

System monitoring

AWS offers their own integrated monitoring tools, most notably, CloudWatch. But you might sometimes need to dig a bit deeper into a particular instance. Running

$ top

…from the command line will display the top resource-consuming processes and associated data in real time. The output will look like this:
Linux Cloud
You may also want to view the system logs that live in the /var/log directory tree:

$ cd /var/log
$ ls
apt       cloud-init-output.log  dmesg.0    lastlog              upstart
auth.log  cloud-init.log         fsck       syslog               wtmp
boot.log  dist-upgrade           kern.log   udev
btmp      dmesg                  landscape  unattended-upgrades

Other Linux cloud skills

If you want to enjoy a relatively smooth flight through the Linux cloud, you’ll definitely want at least a basic grasp of Linux scripting and database  management. Working with script-based AWS services like CloudFormation or the EC2 Container Service will go much better if you’re already familiar with the way scripts work natively within Linux itself. And even something as simple as passing commands to an AWS instance at launch time through shell scripts or cloud-init directives will require some scripting experience.
Similarly, connecting to an AWS RDS (Relational Database Service) instance will be a whole lot easier if you’ve done it already within a local installation of Linux.
The bottom line is that, in most cases at least, serious Cloud Computing will require some serious use of the Linux Cloud. If you’re not yet completely comfortable with the core Linux skills, consider taking Cloud Academy’s LPIC Linux Server Professional certification courses.

Written by

David Clinton

A Linux system administrator with twenty years' experience as a high school teacher, David has been around the industry long enough to have witnessed decades of technology trend predictions; most of them turning out to be dead wrong.

Related Posts

— February 11, 2019

WaitCondition Controls the Pace of AWS CloudFormation Templates

AWS's WaitCondition can be used with CloudFormation templates to ensure required resources are running.As you may already be aware, AWS CloudFormation is used for infrastructure automation by allowing you to write JSON templates to automatically install, configure, and bootstrap your ...

Read more
  • AWS
— January 24, 2019

The 9 AWS Certifications: Which is Right for You and Your Team?

As companies increasingly shift workloads to the public cloud, cloud computing has moved from a nice-to-have to a core competency in the enterprise. This shift requires a new set of skills to design, deploy, and manage applications in the cloud.As the market leader and most mature p...

Read more
  • AWS
  • AWS certifications
— November 28, 2018

Two New EC2 Instance Types Announced at AWS re:Invent 2018 – Monday Night Live

The announcements at re:Invent just keep on coming! Let’s look at what benefits these two new EC2 instance types offer and how these two new instances could be of benefit to you. If you're not too familiar with Amazon EC2, you might want to familiarize yourself by creating your first Am...

Read more
  • AWS
  • EC2
  • re:Invent 2018
— November 21, 2018

Google Cloud Certification: Preparation and Prerequisites

Google Cloud Platform (GCP) has evolved from being a niche player to a serious competitor to Amazon Web Services and Microsoft Azure. In 2018, research firm Gartner placed Google in the Leaders quadrant in its Magic Quadrant for Cloud Infrastructure as a Service for the first time. In t...

Read more
  • AWS
  • Azure
  • Google Cloud
Khash Nakhostin
— November 13, 2018

Understanding AWS VPC Egress Filtering Methods

In order to understand AWS VPC egress filtering methods, you first need to understand that security on AWS is governed by a shared responsibility model where both vendor and subscriber have various operational responsibilities. AWS assumes responsibility for the underlying infrastructur...

Read more
  • Aviatrix
  • AWS
  • VPC
— November 10, 2018

S3 FTP: Build a Reliable and Inexpensive FTP Server Using Amazon’s S3

Is it possible to create an S3 FTP file backup/transfer solution, minimizing associated file storage and capacity planning administration headache?FTP (File Transfer Protocol) is a fast and convenient way to transfer large files over the Internet. You might, at some point, have conf...

Read more
  • Amazon S3
  • AWS
— October 18, 2018

Microservices Architecture: Advantages and Drawbacks

Microservices are a way of breaking large software projects into loosely coupled modules, which communicate with each other through simple Application Programming Interfaces (APIs).Microservices have become increasingly popular over the past few years. The modular architectural style,...

Read more
  • AWS
  • Microservices
— October 2, 2018

What Are Best Practices for Tagging AWS Resources?

There are many use cases for tags, but what are the best practices for tagging AWS resources? In order for your organization to effectively manage resources (and your monthly AWS bill), you need to implement and adopt a thoughtful tagging strategy that makes sense for your business. The...

Read more
  • AWS
  • cost optimization
— September 26, 2018

How to Optimize Amazon S3 Performance

Amazon S3 is the most common storage options for many organizations, being object storage it is used for a wide variety of data types, from the smallest objects to huge datasets. All in all, Amazon S3 is a great service to store a wide scope of data types in a highly available and resil...

Read more
  • Amazon S3
  • AWS
— September 18, 2018

How to Optimize Cloud Costs with Spot Instances: New on Cloud Academy

One of the main promises of cloud computing is access to nearly endless capacity. However, it doesn’t come cheap. With the introduction of Spot Instances for Amazon Web Services’ Elastic Compute Cloud (AWS EC2) in 2009, spot instances have been a way for major cloud providers to sell sp...

Read more
  • AWS
  • Azure
  • Google Cloud
  • SpotInst
— August 23, 2018

What are the Benefits of Machine Learning in the Cloud?

A Comparison of Machine Learning Services on AWS, Azure, and Google CloudArtificial intelligence and machine learning are steadily making their way into enterprise applications in areas such as customer support, fraud detection, and business intelligence. There is every reason to beli...

Read more
  • AWS
  • Azure
  • Google Cloud
  • Machine Learning
— August 17, 2018

How to Use AWS CLI

The AWS Command Line Interface (CLI) is for managing your AWS services from a terminal session on your own client, allowing you to control and configure multiple AWS services.So you’ve been using AWS for awhile and finally feel comfortable clicking your way through all the services....

Read more
  • AWS