从 Windows SSH 到 EC2 linux 实例
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5264945/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SSH to EC2 linux instance from Windows
提问by Austin Richardson
I'm setting up a "data analysis on the cloud" class and most of the students will probably be using Windows.
我正在开设“云端数据分析”课程,大多数学生可能会使用 Windows。
The students will have to set up EC2 Ubuntu instances and connect to them.
学生必须设置 EC2 Ubuntu 实例并连接到它们。
What is the easiest way to set up SSH for Windows XP-7?
为 Windows XP-7 设置 SSH 的最简单方法是什么?
I've tried PuTTY but Puttygen can only convert the public key to putty format if I manually add newlines in a text editor. This is too involved for the class of 80.
我试过 PuTTY,但如果我在文本编辑器中手动添加换行符,Puttygen 只能将公钥转换为 Putty 格式。这对于 80 岁的班级来说太复杂了。
I've tried OpenSSH but I can't seem to find the correct permissions for the public key file. On Mac OS/Linux it's just chmod 600
.
我尝试过 OpenSSH,但似乎找不到公钥文件的正确权限。在 Mac OS/Linux 上,它只是chmod 600
.
Is there a decent SSH client that supports Amazon's key format that I can set up easily?
是否有一个体面的 SSH 客户端支持亚马逊的密钥格式,我可以轻松设置?
回答by wkl
The .pem file Amazon Web Services gives you is supported by the openssh client implementations, but for a Windows-based client that works directly with the .pem file without converting it with puttygen.exe, look into Bitvise Tunnelier.
Amazon Web Services 为您提供的 .pem 文件受 openssh 客户端实现的支持,但对于直接使用 .pem 文件而不使用 puttygen.exe 进行转换的基于 Windows 的客户端,请查看Bitvise Tunnelier。
回答by gonzobrains
Another possible solution is to use PuTTYbut follow Amazon's guide for doing so. I found some other guide's that weren't as clear in the steps but I was able to get PuTTYgen to work correctly when I used their guide.
另一种可能的解决方案是使用PuTTY,但请按照亚马逊的指南进行操作。我发现其他一些指南在步骤中不太清楚,但是当我使用他们的指南时,我能够让 PuTTYgen 正常工作。
- Install PuTTY.
- Follow Amazon's guidefor converting your PEM file to the PuTTY PPK format.
- Connect to your server!
As for newlines, maybe you need to run unix2dosor some other program that will fix that for you?
至于换行符,也许您需要运行unix2dos或其他一些程序来解决这个问题?
回答by Rex
Step1: Download the keypair
第一步:下载密钥对
The download will create a .pem file on your local system. It contains a private keythat you can use to connect to the EC2 instance via SSH
下载将在您的本地系统上创建一个 .pem 文件。它包含一个私有密钥,您可以使用它通过 SSH 连接到 EC2 实例
Step 2: Launch your linux instance
第 2 步:启动您的 linux 实例
Copy the public ip address for the future use to connect the linux instance
复制公网ip地址,供以后连接linux实例使用
Step 3:Download puttyGen from https://the.earth.li/~sgtatham/putty/latest/w32/puttygen.exe
第 3 步:从https://the.earth.li/~sgtatham/putty/latest/w32/puttygen.exe下载 puttyGen
Step 4:Execute the PuttyGen exe and load the private key(the pem file you have downloaded while launching the instance)
步骤4:执行PuttyGen exe并加载私钥(启动实例时下载的pem文件)
Step 5:Save the private key, it will give the .ppk file which will be used to connect the linux instance
第 5 步:保存私钥,它将提供用于连接 linux 实例的 .ppk 文件
Step 6:Download and install the Putty software, open the putty, and paste the public ip address which you copied from the linux instance
第六步:下载安装Putty软件,打开putty,粘贴你从linux实例复制的公网IP地址
Step 7:Now load the .PPK file which we have saved
第 7 步:现在加载我们保存的 .PPK 文件