[AWS] SSH into EC2 instanse
When Launch a new EC2 instance, in the final step, you can create a new private key pair and download it as pem file.
For example, I have one call `mynewkeypair.pem`.
Secrity group:
When creating security group, you need to make sure, you have allow `Anywhere` for `HTTP` & `SSH` (just for testing, not for production)
1. Change premission for pem file:
chmod 400 mynewkeypair.pem
2. SSH into EC2:
ssh ec2-user@<public_ipv4_address> -i mynewkeypair.pem
You can find <public_ipv4_address> in EC2 instanse information.
3. Type `yes` to continue
4. When successfully login, you will see:
Now, let's say, we want to turn our linux server as web hosting server.
1. Switch to root user
sudo su
2. Check any packages need to be udpated
yum update -y
3. Install Apache server:
yum install httpd -y
4. Start the server:
systemctl start httpd
This start the server manually, if we want to start the server automaticlly when the server bootstrap, we can do:
systemctl enable httpd
5. Verify:
systemctl status httpd
You can see:
Active: active (running) since Mon 2021-03-22 08:43:11 UTC; 1min 59s ago
6. Add new webpage:
cd /var/www/html nano index.html
Add simple html:
<html><body><h1>Hello Cloud Guru!!</h1></body></html>
Save the file:
Ctrl + X
Y
Enter
7. See the page:
Copy the Public IP address and paste into browser, you should see the hello message
相关文章
- AWS re:Invent:SRD协议将取代TCP?
- 飞总带大家解读 AWS re:Invent 2022大数据相关的发布,一句话总结:惨不忍睹。。。
- 从AWS自研交换机的初心看背锅侠的未来
- AWS网络架构,抄作业是不可能的!
- AWS教程—解决网站加载缓慢的难题
- MySQL Error number: MY-011428; Symbol: ER_KEYRING_AWS_INIT_FAILURE; SQLSTATE: HY000 报错 故障修复 远程处理
- Linux SSH登录失败:解决方案(linux无法ssh登录)
- Linux下如何开启SSH服务(linux如何打开ssh)
- 服务Linux查看SSH服务:实战指南(linux怎么查看ssh)
- Linux启用SSH远程访问(linux启用ssh)
- 的安装Linux下SSH的安装:轻松连接远程服务器(linux下ssh)
- 安全登录Linux SSH安全登录指南(linux如何ssh)
- 体验Linux之旅:探索SSH的奥秘(linux如何使用ssh)
- 使用SSH访问MySQL源码:安全又便捷(ssh项目源码mysql)
- 安装新手快速上手:SSH虚拟机安装Linux系统(ssh虚拟机linux)
- AWS、Azure 客户证实 Intel 漏洞导致服务器变慢
- AWS 日本出现大规模故障
- AWS CEO 180分钟演讲,透露AWS业务现状,并“疯狂”输出27款新发布
- Linux启用SSH远程访问实现安全连接(linux启动ssh)
- Linux连接SSH:极速体验架构分享(linux连接ssh)
- Linux 系统快速安装SSH服务指南(linux 安装ssh)
- 控制利用AWS建立MySQL用户控制权限(aws mysql 用户)
- 云上的挑战AWS与Oracle的对比(AWS 和oracle)
- 使用SSH登录Redis服务器(ssh 登陆redis)
- SSH实现Redis集群整合赋予资源集群新的生命力(ssh整合redis集群)