- Effective DevOps with AWS
- Nathaniel Felsen
- 168字
- 2021-07-15 17:11:51
Connecting to the EC2 instance using ssh
The main goal of this chapter is to create a simple Hello World web application. Since we are starting off with a vanilla OS, we need to connect to the host to make the necessary changes to turn our standard server into a web server. In order to ssh our instance, we need to find the DNS name of our running instance, as follows:
$ aws ec2 describe-instances \ --instance-ids i-97000624 \ --query "Reservations[*].Instances[*].PublicDnsName" [ [ "ec2-54-88-134-38.compute-1.amazonaws.com" ] ]
We now have the public DNS name of our instance and the private key to ssh into our instance. The last thing to know is that in Amazon Linux for the OS that we selected when we chose our AMI, the default user account is called ec2-user:
$ ssh -i ~/.ssh/EffectiveDevOpsAWS.pem ec2-user@ec2-54-88-134-38.compute-1.amazonaws.com __| __|_ ) _| ( / Amazon Linux AMI ___|\___|___| [ec2-user@ip-172-31-22-234 ~]$
If you experience any sort of issue, add the -vvv option in your ssh command to troubleshoot it.
推薦閱讀
- Oracle從入門到精通(第3版)
- iOS面試一戰到底
- C# 2012程序設計實踐教程 (清華電腦學堂)
- Vue.js快跑:構建觸手可及的高性能Web應用
- 我的第一本算法書
- 從0到1:HTML+CSS快速上手
- Full-Stack Vue.js 2 and Laravel 5
- Scala編程實戰(原書第2版)
- PySpark Cookbook
- Android系統級深入開發
- SQL Server數據庫管理與開發兵書
- 時空數據建模及其應用
- Spring技術內幕:深入解析Spring架構與設計原理(第2版)
- Joomla!Search Engine Optimization
- Software Architecture with Python