首页 > 其他分享 >AWS 中的另外一种远程工具 AWS Session Manager

AWS 中的另外一种远程工具 AWS Session Manager

时间:2023-05-11 12:46:17浏览次数:42  
标签:cnsre www cn AWS ssm Manager Session https

> 作者:[SRE运维博客](https://www.cnsre.cn/)
> 博客地址:[https://www.cnsre.cn/](https://www.cnsre.cn/) 
> 文章地址:[https://www.cnsre.cn/posts/230129126154/](https://www.cnsre.cn/posts/230129126154/)
> 相关话题:[https://www.cnsre.cn/tags/aws/](https://www.cnsre.cn/tags/aws/)

背景需求

因为项目的安全性。为了避免项目的服务器暴露在公网中。很多时候我们会使用跳板机或者是一些三方的远程工具,来进行一些安全性比较高的方式来进行远程项目的服务器,但是往往越安全的方式就越麻烦。那有没有一种既安全,有便捷的连接方式呢?当然有,今天就介绍下AWS Session Manager。

前置需求

{{< alert theme="success" dir="ltr" >}}

  • 一台 EC2 服务器(需要开启 SSM 远程服务并分配权限)
  • 一个 AWS 账户

安装配置 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

给 EC2 分配对应权限

角色管理中选择创建角色
如下如图所示选择对应选项。
sre运维|Linux运维|关键词
搜索AmazonSSMFullAccess 选择下一步
sre运维|Linux运维|关键词
填入角色名称,然后创建角色
sre运维|Linux运维|关键词
AWS EC2 控制台中找到对应的服务器,然后点击操作``安全 修改IAM角色
sre运维|Linux运维|关键词
在框内搜索刚才创建的角色名称。然后确定选择。
sre运维|Linux运维|关键词

AWS 中的远程链接方式 Session Manager

安装完以后可以在AWS 中我们可以直接通过控制台去链接 Linux 服务器,如下图。在选中实例以后 在右上角中选择连接。然后再次进行远程登录服务。
sre运维|Linux运维|关键词

sre运维|Linux运维|关键词
{{< alert theme="warning" dir="ltr" >}}
如遇到无法远程的情况请按照下面的方法将安装ssm服务。

在 SSM 中进行远程链接

在控制台 Amazon Systems Manager 中选择 Session Manager
sre运维|Linux运维|关键词
选择启动会话。
sre运维|Linux运维|关键词
选择对应的实例 然后点击启动会话。
sre运维|Linux运维|关键词
然后就进入到了系统界面。
sre运维|Linux运维|关键词

{{< alert theme="success" dir="ltr" >}}
如何通过IAM让不同的 aws 用户拥有不同的远程服务器权限?下篇文章将会介绍 Session Manager 的进阶用法


作者:SRE运维博客
博客地址:https://www.cnsre.cn/
文章地址:https://www.cnsre.cn/posts/230129126154/
相关话题:https://www.cnsre.cn/tags/aws/


标签:cnsre,www,cn,AWS,ssm,Manager,Session,https
From: https://www.cnblogs.com/cnsre/p/17390721.html

相关文章

  • SQLiteManager 第零部分
    一个Unity的SQLite持久化框架,剔除了Json序列化部分的功能,只保留了与SQLite相关的功能SQLiteManager脚本挂载即可使用,如果主要用代码调用则只需要SQLiteManager。另外还有TableTool和TableEditor但不是必要的为了方便查看分成了几部分,这是框架需要用到的自定义类namespaceSave......
  • Pytest - xdist 保证多进程共享 session 级别fixture
    背景:搜索自动化不同的测试文件件需要使用相同的变量解决:importloggingfromtoolsimportset_loggingimportpytestimporttimefromfilelockimportFileLockimportjsonimportosset_logging.set_test_log()@pytest.fixture(scope="session")defget_batch_i......
  • Grafana 系列-统一展示-5-AWS Cloudwatch 仪表板
    系列文章Grafana系列文章......
  • Failed to open connection to "session" message bus: Using X11 for dbus-daemon au
    Failedtoopenconnectionto"session"messagebus:UsingX11fordbus-daemonautolaunchwasdisabledatcompiletime,setyourDBUS_SESSION_BUS_ADDRESSinstead4Failedtoopenconnectionto"session"messagebus:UsingX11fordbus-da......
  • Linux部署Prometheus+Alertmanager并配置企业微信告警
    一、Prometheus告警简介告警能力在Prometheus的架构中被划分成两个独立的部分。如下所示,通过在Prometheus中定义AlertRule(告警规则),Prometheus会周期性的对告警规则进行计算,如果满足告警触发条件就会向Alertmanager发送告警信息。在Prometheus中一条告警规则主要由以下几部分组......
  • Linux部署Prometheus+Alertmanager并配置邮件告警
    一、Prometheus告警简介告警能力在Prometheus的架构中被划分成两个独立的部分。如下所示,通过在Prometheus中定义AlertRule(告警规则),Prometheus会周期性的对告警规则进行计算,如果满足告警触发条件就会向Alertmanager发送告警信息。在Prometheus中一条告警规则主要由以下几部分组......
  • Linux部署Prometheus+Alertmanager并配置钉钉告警
    一、Prometheus告警简介告警能力在Prometheus的架构中被划分成两个独立的部分。如下所示,通过在Prometheus中定义AlertRule(告警规则),Prometheus会周期性的对告警规则进行计算,如果满足告警触发条件就会向Alertmanager发送告警信息。在Prometheus中一条告警规则主要由以下几部分组......
  • Python_16 session、cookie 鉴权
    一、查缺补漏1.pprint https://www.cnblogs.com/yjybupt/p/10669988.html https://www.cnblogs.com/wongbingming/p/12854618.html 2.鉴权: http://testingpai.com/article/1621929988356 3.importjson json.du......
  • Django高级之-cookie与session
    目录1背景信息cookie的介绍cookie的由来什么是cookiecookie的原理Cookie规范Cookie的覆盖在浏览器中查看cookiesession的介绍session的由来什么是sessiontoken的介绍token的由来什么是token?Django操作cookie设置cookie获取cookie删除CookieCookie版登录校验案例Django操作Session......
  • flink Connecting to remote task manager 'localhost/127.0.0.1:44489
    问题:启动集群后,执行任务时失败:Causedby:org.apache.flink.runtime.io.network.partition.consumer.PartitionConnectionException:Connectionforpartition47d4a412246bdbbc3447e1968e07c821#1@04049d45261135a1a8bae9c8f62a1ba4_0a448493b4782967b150582570326227_1_0not......