使用ssh命令连接aws服务器,ssh命令如下
```
$ ssh -i "aws.pem"
[email protected]
```
连接不上服务器,并报错
```
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'aws.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 "aws.pem": bad permissions
[email protected]: Permission denied (publickey).
```
原因是 aws.pem 文件没有权限,赋权即可,命令如下
```
chmod 700 aws.pem
```
再次连接服务器,成功登录