
前言
除了甲骨文可以申请免费vps外还有一个比较热门的是亚马逊的12月免费使用,高频 Intel Xeon 处理器性能可突增的 CPU1核 1G30GB SSD多操作系统可选,只要不超过免费量跑些东西还是不错的。
注册亚马逊云账户流程
注册地址:https://aws.amazon.com/cn/campaigns/aws-cloudserver/
1,这边教程是选择海外区

2,开始注册,电子邮箱最好是用谷歌的gmail邮箱,密码需要大小写,账户名称随便填

3,登录你的注册邮箱,会收到一个验证码

4,电子邮件验证成功,接下来创建你的账户密码,

5,填入你的联系资料,我是自己的信息注册的,所以名字写自己的拼音、国内的电话号码、国内的地址(需要注意的是需要和信用卡真实信息,不然申请不下来
),如图:

6,填写外币信用卡信息,亚马逊AWS云会以待处理交易的方式暂时扣取1USD/EUR3-5天,用以验证身份,最好是用visa卡了,暂扣1美元的费用,验证完毕之后过一段时间就会返还给你这1美元,不用担心。

8,验证手机号
选择账户计划,选择默认即可,完成注册
创建AWS实例
登录控制台,这里可以选服务器的地址,在右上角导航栏上,搜索EC2,点击后进入EC2页面

第一次进来, 应该没有任何实例, 接下来, 就一步步创建海外服务器. 首先在右上角选择地区节点, 这里选择的是加利福尼亚北部.也可选择其他免费选项地区

点击上图的启动新实例, 进入创建实例的引导. 如下图所示.
设定实例名称,选择操作系统镜像, 这里保持 Amazon Linux 默认就行.
注意, 右侧有一个摘要, 其中包含一个免费套餐说明, 第一年每月 750 小时 (31.25 天) 免费服务器使用, 即第一年免费. 免费服务的配置, 包含 1vCPU, 1GiB 内存, 30GB SSD 硬盘.

为了登录服务器, 需要密钥对, 如果之前没有, 可以创建新密钥对, 创建好以后, 会得到一个 xxx.pem 文件, 下载到本地, 一定要妥善保管!!! 后面登录服务器需要用到.

接下来, 配置防火墙, 这里勾选了 SSH/HTTPS/HTTP, 你可以视需要而定. 配置存储, 免费套餐, 最多 30GiB.

这样基本就配置好啦~点击右侧启动实例, 就可以启动啦. 为了远程登录服务器, 我们选择 SSH 客户端, 下面有一个完整说明, 参照处理即可.

完成后就可在终端, 用 ssh 命令就登录啦
修改root账户
进入root账户使用su root
也需要密码,不然直接修改root密码和登录ssh
1 | echo root:TIAN |sudo chpasswd root |
执行以上命令后,root密码为:TIAN,修改密码后请及时修改为自己的密码
进入root命令:
1 | su root |
输入初始root密码进入root
修改root密码命令:
1 | passwd root |
打开防火墙
如果你的 VPS 有外部防火墙,请确保你已经开放了端口
测试端口是否能连接上:打开 https://ping.sx/check-port
Target 写你的 VPS服务器的 IP,Port 写服务端的端口,然后点击 Check。
如果 REACHABILITY 显示 Timeout,那是无法连接上端口
需要打开防火墙,对于亚马逊云来说,需要修改你的EC2实例的安全组规则,入站规则改为对所有流量开放

如何确保在使用 AWS 免费套餐时不产生费用
虽然是免费使用,但是超出免费使用量还是会扣费的,所以为了避免使用扣费需要及时留意
可以参考官方方法:https://repost.aws/zh-Hans/knowledge-center/free-tier-charges
使用 AWS Budgets 监控免费套餐使用情况
