amazon-web-services - AWS 在私有子网中的 EC2 实例之间进行 ssh 的最佳方法
问题描述
我已将 NAT 和堡垒设置为使用 SSH 转发登录:
ssh-add -K keyfile.pem
ssh -A ec2-user@bastionhost
ssh ec2-user@privateSubnetServer
此时在私有子网中的主机之间处理 ssh 和用户的最佳方法是什么?
我得到:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
尝试以传统的 linux 方式进行操作时。如果我使用 AWS 创建的密钥对,我可以找到它们。
此时我无法设置或连接到目录服务。
解决方案
Host bastion.ip.address
User ec2-user
IdentityFile ~/.ssh/bastionkey.pem
CheckHostIP no
Host private.subnet.ip
User ec2-user
IdentityFile ~/.ssh/bastionkey.pem
ProxyCommand ssh ec2-user@bastion.host.ip -W %h:%p
推荐阅读
- django - Django 登录到 wxpython 窗口?
- symfony4 - Api平台错误处理异常?
- dictionary - ansible - 组合三个字典列表
- fortran - 是否可以将 Fortran 派生数据类型指针指向内在数据类型?
- facebook-messenger - 我的 facebook messenger webhook 没有收到未使用与 fb 应用程序相同的帐户创建的页面的消息
- asp.net - 如何保存由 Microsoft.Office.Interop.Excel 生成的文件
- pyspark - 属性错误?Pyspark 数据帧()错误
- sql-server - Transact SQL:具有特定逻辑的有序行内的字符串连接
- c# - 请求失败,HTTP 状态 401:调用 Web 服务时未授权
- ruby - Ruby `cweek` 返回 1 而不是 53