Set up to use Amazon EC2
Complete the tasks in this section to get set up for launching an Amazon EC2 instance for the first time:
When you are finished, you will be ready for the Amazon EC2 Getting started tutorial.
Sign up for an Amazon Web Services account
If you do not have an Amazon Web Services account, use the following procedure to create one.
To sign up for Amazon Web Services
Open http://www.amazonaws.cn/
and choose Sign Up. Follow the on-screen instructions.
Amazon sends you a confirmation email after the sign-up process is
complete. At any time, you can view your current account activity and manage your account by
going to http://www.amazonaws.cn/
Secure IAM users
After you sign up for an Amazon Web Services account, safeguard your administrative user by turning on multi-factor authentication (MFA). For instructions, see Enable a virtual MFA device for an IAM user (console) in the IAM User Guide.
To give other users access to your Amazon Web Services account resources, create IAM users. To secure your IAM users, turn on MFA and only give the IAM users the permissions needed to perform their tasks.
For more information about creating and securing IAM users, see the following topics in the IAM User Guide:
Create a key pair
Amazon uses public-key cryptography to secure the login information for your instance. A Linux instance has no password; you use a key pair to log in to your instance securely. You specify the name of the key pair when you launch your instance, then provide the private key when you log in using SSH.
If you haven't created a key pair already, you can create one by using the Amazon EC2 console. Note that if you plan to launch instances in multiple Amazon Web Services Regions, you'll need to create a key pair in each Region. For more information about Regions, see Regions and Zones.
To create your key pair
Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/
. -
In the navigation pane, choose Key Pairs.
-
Choose Create key pair.
-
For Name, enter a descriptive name for the key pair. Amazon EC2 associates the public key with the name that you specify as the key name. A key name can include up to 255 ASCII characters. It can’t include leading or trailing spaces.
-
For Key pair type, choose either RSA or ED25519. Note that ED25519 keys are not supported for Windows instances.
-
For Private key file format, choose the format in which to save the private key. To save the private key in a format that can be used with OpenSSH, choose pem. To save the private key in a format that can be used with PuTTY, choose ppk.
-
Choose Create key pair.
-
The private key file is automatically downloaded by your browser. The base file name is the name you specified as the name of your key pair, and the file name extension is determined by the file format you chose. Save the private key file in a safe place.
Important
This is the only chance for you to save the private key file.
-
If you plan to use an SSH client on a macOS or Linux computer to connect to your Linux instance, use the following command to set the permissions of your private key file so that only you can read it.
chmod 400
key-pair-name
.pemIf you do not set these permissions, then you cannot connect to your instance using this key pair. For more information, see Error: Unprotected private key file.
For more information, see Amazon EC2 key pairs and Linux instances.
Create a security group
Security groups act as a firewall for associated instances, controlling both inbound and outbound traffic at the instance level. You must add rules to a security group that enable you to connect to your instance from your IP address using SSH. You can also add rules that allow inbound and outbound HTTP and HTTPS access from anywhere.
Note that if you plan to launch instances in multiple Amazon Web Services Regions, you'll need to create a security group in each Region. For more information about Regions, see Regions and Zones.
Prerequisites
You'll need the public IPv4 address of your local computer. The security group editor in
the Amazon EC2 console can automatically detect the public IPv4 address for you.
Alternatively, you can use the search phrase "what is my IP address" in an internet
browser, or use the following service: Check IP
You can create a custom security group using one of the following methods.
For more information, see Amazon EC2 security groups for Linux instances.