共计 1648 个字符,预计需要花费 5 分钟才能阅读完成。
作者:SRE 运维博客
博客地址:https://www.cnsre.cn/
文章地址:https://www.cnsre.cn/posts/230129126154/
相干话题:https://www.cnsre.cn/tags/aws/
背景需要
因为我的项目的安全性。为了防止我的项目的服务器裸露在公网中。很多时候咱们会应用跳板机或者是一些三方的近程工具,来进行一些安全性比拟高的形式来进行近程我的项目的服务器,然而往往越平安的形式就越麻烦。那有没有一种既平安,有便捷的连贯形式呢?当然有,明天就介绍下 AWS Session Manager。
前置需要
{{< alert theme=”success” dir=”ltr” >}}
- 一台 EC2 服务器(须要开启
SSM
近程服务并调配权限) - 一个 AWS 账户
{{< /alert >}}
装置配置 SSM Agent
在 Amazon Linux 2 中装置 SSM Agent
x86_64
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
ARM64
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_arm64/amazon-ssm-agent.rpm
在 CentOS 7.x 上装置 SSM Agent
x86_64
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
ARM64
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_arm64/amazon-ssm-agent.rpm
启动服务并设置为开机启动
sudo systemctl status amazon-ssm-agent
sudo systemctl enable amazon-ssm-agent
{{< alert theme=”warning” dir=”ltr” >}}
如其余零碎装置请参考 在实用于 Linux 的 EC2 实例上手动装置 SSM Agent
{{< /alert >}}
给 EC2 调配对应权限
在角色治理中抉择 创立角色
。
如下如图所示抉择对应选项。
搜寻AmazonSSMFullAccess
抉择下一步
填入角色名称,而后创立角色
在 AWS EC2 控制台中找到对应的服务器,而后点击 操作
` 平安
批改 IAM 角色 `
在框内搜寻方才创立的角色名称。而后确定抉择。
AWS 中的近程链接形式 Session Manager
装置完当前能够在 AWS 中咱们能够间接通过控制台去链接 Linux 服务器,如下图。在选中实例当前 在右上角中抉择连贯。而后再次进行近程登录服务。
{{< alert theme=”warning” dir=”ltr” >}}
如遇到无奈近程的状况请依照上面的办法将装置 ssm 服务。
{{< /alert >}}
在 SSM 中进行近程链接
在控制台 Amazon Systems Manager 中抉择 Session Manager
抉择启动会话。
抉择对应的实例 而后点击启动会话。
而后就进入到了零碎界面。
{{< alert theme=”success” dir=”ltr” >}}
如何通过 IAM 让不同的 aws 用户领有不同的近程服务器权限?下篇文章将会介绍 Session Manager 的进阶用法
{{< /alert >}}
作者:SRE 运维博客
博客地址:https://www.cnsre.cn/
文章地址:https://www.cnsre.cn/posts/230129126154/
相干话题:https://www.cnsre.cn/tags/aws/