在AWS VPC中免费SSH [英] SSH freely inside AWS VPC

查看:83
本文介绍了在AWS VPC中免费SSH的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何配置VPC内的EC2机器使其能够在没有密码或密钥的情况下进行ssh操作?

How do I configure my EC2 machines inside a VPC to be able to ssh without password or key between them?

我要执行的操作是访问一个

What i'm trying to do is access one machine (which has a public IP) and from this machine access all others freely.

甚至有可能吗?

推荐答案

首先,需要设置VPC中的所有计算机以接受来自本地计算机的密钥-由您手动分配还是使用自动化工具(如厨师为您完成此操作。

Firstly all the machines in your VPC need to be set up to accept the key from your local machine - it's up to you whether you distribute this manually, or use an automated tool such as Chef to do this for you.

接下来,您需要在本地计算机上运行ssh-agent,并为其提供密钥。基本上,它位于后台,并在ssh客户端需要它们时分发密钥。在Windows上,您可以使用Pageant,它可以很好地与PuTTY配合使用。如果您使用的是Linux,则需要运行 ssh-agent ,并使用 ssh-add 它是你的钥匙。请注意,完全有可能自动运行ssh-agent,因此您仍然可以使用脚本-我按照

Next you need to run an ssh-agent on your local machine, and give it your keys. basically this sits in the background and hands out keys whenever your ssh client needs them. On Windows you can use Pageant, which plays nicely with PuTTY. If you're using Linux, you'll need to run ssh-agent, and use ssh-add to give it your keys. Note that it's perfectly possible to run the ssh-agent automatically, so you can still use scripts - I set mine up following this.

最后,在进行初始设置时,您需要允许SSH代理转发与您公开可见的AWS服务器的连接。在PuTTY中,您可以在SSH /身份验证/允许代理转发下执行此操作(请确保不要指定私钥文件)。从Linux命令行,您需要编辑〜/ .ssh / config文件。在此处

Finally, you need to allow SSH agent forwarding when you make the initial connection to your publicly visible AWS server. In PuTTY you do this under SSH / Auth / Allow agent forwarding (Make sure you don't specify a private key file). From a Linux command line, you need to edit your ~/.ssh/config file. There's a good guide on setting this up here

这篇关于在AWS VPC中免费SSH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆