The last time Got a ticket , On the aws This huge ship , I'm going to have a free dinner in the free restaurant on the ship today —— Whole set aws Free package Medium EC2 Server experience .
Get into EC2 Console , Click on “ Boot instance ”, Get into AMI System image selection page , Check “ Free package only ”, Choose one of the free servers , Here we choose Ubuntu 20.04
The instance configuration in the free package is 1 nucleus 1G
Click on “ Audit and launch ”, Get into “ Verification instance starts ” page , Click on “ start-up ”, appear “ Select an existing key pair or create a new key pair ” Dialog box
Choose to create a new key pair , Enter key pair name , Click on “ Download the key pair ”, Will download a cnblogs.pem file (ssh Private key file ).
Click on “ Boot instance ”, Encounter startup failure
This is due to the use of our current geographic location “ The west of the United States ( Northern California ) us-west-1” The cloud resource needs an additional verification process .
Try another area , Switch to “ The eastern part of the United States ( Ohio Prefecture ) us-east-2”, This area doesn't need to be verified , The instance was started successfully .
meanwhile , Yes, the title is "Your Request For Accessing AWS Resources Has Been Validated" The mail ,us-west-1 Regional verification has also passed .
You recently requested an AWS Service that required additional validation. Your request has now been validated for AWS US West (N. California) region(s).
In the process of verification, it deducted from the credit card 1 dollar ( It will be returned just like when you register ).
Get into EC2 The console can view the instance information just started
Get the public network of the server instance IP Address ,ssh Log in and try ( The default username is ubuntu)
$ ssh [email protected] The authenticity of host '3.139.91.143 (3.139.91.143)' can't be established. ECDSA key fingerprint is SHA256:67G0raEM3ml9PqREBefoq2108ZHBwywWXpWiKiuZ4E8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '3.139.91.143' (ECDSA) to the list of known hosts. [email protected]: Permission denied (publickey).
ssh Key verification failed , You need to use the cnblogs.pem Key file login
$ ssh -i cnblogs-us-east-2.pem [email protected] @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0644 for 'cnblogs-us-west-1.pem' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "cnblogs-us-west-1.pem": bad permissions [email protected]: Permission denied (publickey).
Failed again. , This time it's about the permissions of the key file ,644 jurisdiction (-rw-r--r--@) It's so open , unsafe , use chmode Command to change the permissions to 400(-r--------)
chmod 400 cnblogs-us-east-2.pem
After modifying the authority ssh Login succeeded
$ ssh -i cnblogs-us-east-2.pem [email protected] Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-1024-aws x86_64) ...
If you don't want to ssh Enter the password file , You can use the default key on your computer .
Click on EC2 In the menu on the left side of the console “ Key pair ”, Enter the key pair console , Click the right side. “ operation ” Medium “ Import key pair ”, Import it into your computer ~/.ssh/id_rsa.pub file , After importing successfully , Demand starts new EC2 This key can only be used by instance .
Appears during the start instance operation “ Select an existing key pair or create a new key pair ” In the dialog box, select the key just imported , You don't need to specify a key file directly ssh Log on to the .
$ ssh [email protected] The authenticity of host '18.223.33.137 (18.223.33.137)' can't be established. ECDSA key fingerprint is SHA256:LIRxVm471JB9gLRuYJx+S0pueiSaxfBr+neVKuErF5U. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '18.223.33.137' (ECDSA) to the list of known hosts. Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-1024-aws x86_64)
After successful login, use curl Command request garden home page to experience
$ curl -s https://www.cnblogs.com | grep "Powered by" <div class="poweredby">Powered by .NET 5.0.0-rc.2.20475.5 on Kubernetes</div>
aws This is how the free cloud server is organized .