106
votes
What Linux distribution is the Amazon Linux AMI based on?
Instead of guessing which version of RHEL a particular distro is based off, just run:
rpm -E %{rhel}
For Amazon Linux 2, this will give you 7.
93
votes
Accepted
How to install Docker on AWS EC2 instance with AMI (CE/EE Update)
To get Docker running on the AWS AMI you should follow the steps below (these are all assuming you have ssh'd on to the EC2 instance).
Update the packages on your instance
[ec2-user ~]$ sudo yum ...
86
votes
Accepted
How to determine AWS security group dependencies?
Paste the security group ID in the "Network Interfaces" section of EC2. This will find usage across EC2, EB, RDS, ELB.
CLI: aws ec2 describe-network-interfaces --filters Name=group-id,Values=sg-...
70
votes
Accepted
Download SSL certificate from aws certificate manager
You cannot download a SSL certificate from ACM.
58
votes
How to change an EC2 instance's security group
Now you can change the security group of an EC2 instance from the web console itself.
Select an instance -> right click or click Actions -> Under Networking -> select Change Security Groups
50
votes
Accepted
How to know if a machine is an EC2 instance
First, I felt the need to post a new answer because of the following subtle problems with the existing answers, and after receiving a question about my comment on @qwertzguy's answer. Here are the ...
48
votes
Accepted
How to convert a unencrypted EBS to be encrypted
It's possible to copy an unencrypted EBS snapshot to an encrypted EBS snapshot. So the following process can be used:
Stop your EC2 instance.
Create an EBS snapshot of the volume you want to encrypt.
...
43
votes
Cannot SSH: debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
In my case, I have no permission to lower the MTU size. And manually specifying the Cipher does not work.
I am able to connect after shortening the MACs list by specifying one, e.g.:
ssh -o MACs=...
41
votes
Accepted
In AWS, how to check which resources are using VPC IP addresses
In the EC2 console, in the navigation pane on the left, click Network Interfaces.
Everything with an IP address -- EC2 instances, ELBs, NAT Gateways, RDS instances (to name some of the more common ...
38
votes
Accepted
How to make EC2 user data script run again on startup?
rm /var/lib/cloud/instances/*/sem/config_scripts_user
Confirmed working on:
CentOS 7.4
Ubuntu 14.04
Ubuntu 16.04
For the sake of completeness, if you have a situation where you care to keep track ...
38
votes
Elastic Beanstalk stuck for more than 12 hrs
If you know how to fix the source of problem (for example: change application settings in Beanstalk Environment variables or deploy fixed version of your application), then:
Go to page Auto Scaling ...
35
votes
Accepted
How do I ensure my AWS free tier plan doesn't exceed the free usage limit?
You can't set a limit on AWS spending. AWS doesn't have a limit function - it's not in their interest, even though they do quite well at putting the customers first and trying to help the customer ...
34
votes
What is "freeable memory"?
It is basically available RAM. See answer from AWS here https://forums.aws.amazon.com/thread.jspa?threadID=209720 and the official documentation is here http://docs.aws.amazon.com/AmazonRDS/latest/...
34
votes
Accepted
What Linux distribution is the Amazon Linux AMI based on?
There's a discussion thread available over on the AWS forums that indicates the officially supported Amazon Linux AMI is not based upon any Linux distribution. Rather, the Amazon Linux AMI is ...
34
votes
amazon linux 2 ami - aws - How to install mysql in Amazon Linux 2?
I got the answer myself. Follow the below steps:
sudo wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum localinstall mysql57-community-release-el7-11.noarch.rpm
...
32
votes
Accepted
How to add a Tag when launching an ec2 instance using aws clis
As of 28 March 2017, you can specify tags for instances (and attached volumes) as part of the run-instances command.
Example:
aws ec2 run-instances --image-id ami-abc12345 --count 1 \
--instance-...
32
votes
Accepted
How to install Certbot on Amazon Linux EC2
For EC2 running Amazon Linux 2 AMI:
Enable EPEL Repo:
sudo amazon-linux-extras install epel
Install Certbot:
sudo yum install certbot-apache
31
votes
Accepted
How to find out an ec2 instance's private and public IP via aws cli?
Generally you can do it with --query filter.
If you need the private IP address only:
aws --region YOUR-AWS-REGION \
ec2 describe-instances \
--filters \
"Name=instance-state-name,Values=running" \
"...
30
votes
Accepted
Fundamental difference between t3 and t3a EC2 instances
Per benchmarks at photographerstechsupport.com, t3 instances tend to be 10 to 20% faster than their equivalently spec'd t3a counterparts. I notice that the precision of some of the benchmark values is ...
29
votes
Accepted
How to choose best EC2 instance for the system
It's easy to change the instance types up, down, or sideways. Don't try to guess which one will work the best for you - instead test it out. If you've got t3a.medium now try upgrading to t3a.large. Or ...
29
votes
What is a secure and user-friendly way to provide only a few users access to web app on Amazon EC2?
Option 4 - stop controlling the access through Security Groups and instead implement some decent authentication mechanism.
For example put an Application Load Balancer in front of the web app and ...
28
votes
xvda1 is 100% full, What is it? how to fix?
I know i am replying in this thread after nearly 5 years but it might help someone,
I had the same problem, i had m4.xlarge instance
df -h told that the /dev/xvda1 was full, - 100%
Filesystem ...
28
votes
Deny IP address on AWS ELB
A straight forward solution is to use a VPC Network ACL Inbound Rule. This only works if your ELB is in a VPC, but if you've created it in the last few years it should be in the default one.
To ban 1....
28
votes
What Linux distribution is the Amazon Linux AMI based on?
Seems like it's based on RHEL:
$ cat /etc/os-release
NAME="Amazon Linux AMI"
VERSION="2017.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2017.09"
PRETTY_NAME="Amazon Linux AMI 2017.09"
ANSI_COLOR="...
26
votes
Accepted
How do I update the Nginx configuration file on many identical servers at the same time?
There are a number of concepts that you can leverage.
The key to success is automation
First option is to keep doing what you're doing now, i.e. rebuild the EC2s with every configuration change. ...
25
votes
Accepted
Do CPU credits exist for c5d.large instances? And if not, why not?
CPU credits only apply to T2/T3 instances. Each T2/T3 instance accumulates some CPU credits per second and also when it's in use (i.e. not "idle") it spends these CPU credits. When it runs out of ...
24
votes
Why does my OpenSSH key fingerprint not match the AWS EC2 console keypair fingerprint?
If you only have public keys, you can generate the AWS fingerprint as follows:
ssh-keygen -e -f id_rsa.pub -m pkcs8 | openssl pkey -pubin -outform der | openssl md5 -c
23
votes
How do I access the attached volume in Amazon EC2
To use a EBS volume attached in the EC2, you need first mount the volume.
Connect to your instance using SSH.
Use the lsblk command to view your available disk devices and their mount points.
[ec2-...
23
votes
How to get Autoscaling group Instances IP adresses
As alternative, my version without any jq/awk/sed/cut
$ aws autoscaling describe-auto-scaling-instances --region us-east-1 --output text \
--query "AutoScalingInstances[?AutoScalingGroupName=='ASG-...
23
votes
Accepted
AWS EC2 deny single ip address and allow all
The only way to deny sources/IP addresses is to use Network ACL's in the VPC. These operate like a firewall allowing or blocking traffic incoming to your subnet, and operate above the Securtiy group ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
amazon-ec2 × 6592amazon-web-services × 2703
linux × 590
ubuntu × 480
amazon-ebs × 412
ssh × 367
amazon-vpc × 264
nginx × 228
apache-2.2 × 209
domain-name-system × 204
amazon-ami × 196
mysql × 190
load-balancing × 187
amazon-s3 × 186
amazon-elb × 182
networking × 175
ssl × 129
php × 122
amazon-rds × 120
amazon-route53 × 113
autoscaling × 112
security × 106
windows × 102
centos × 101
amazon-elastic-ip × 93