无法使用cygwin ssh SSH到AWS Windows实例 [英] can't ssh to AWS Windows instance using cygwin ssh

查看:117
本文介绍了无法使用cygwin ssh SSH到AWS Windows实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里按照说明进行操作: https://docs.oracle.com/cd/E24628_01/install.121/e22624/preinstall_req_cygwin_ssh.htm#EMBSC340

I'm following instruction here: https://docs.oracle.com/cd/E24628_01/install.121/e22624/preinstall_req_cygwin_ssh.htm#EMBSC340

一切正常,直到我到达5.4节的第4步.备份c:\ cygwin \ etc \ passwd文件..."猜猜是什么,没有这样的文件.

Everything works fine until I get to Section 5.4, step 4. "Backup the c:\cygwin\etc\passwd file..." Guess what, there is no such file.

如果我继续操作并打开cyg_server,请尝试从本地框中SSH到它,就像以下任何尝试一样:

If I move on and turn on the cyg_server, then try to ssh to it from my local box, like any of the following attempts:

ssh -i "c:/users/Greg/.ssh/aws.pem" Admininistrator@ec2-52-89-66-113.us-west-2.compute.amazonaws.com
ssh Admininistrator@ec2-52-89-66-113.us-west-2.compute.amazonaws.com 
ssh cyg_server@ec2-52-89-66-113.us-west-2.compute.amazonaws.com 
ssh 52.89.66.113.us-west-2.compute.amazonaws.com

我收到以下消息:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @  
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!  
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:XZpY8q6txT+/CXh45b3JuiI8hMehnmH0s4ZXJWOoWAg.
Please contact your system administrator.
Add correct host key in /home/Greg/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/Greg/.ssh/known_hosts:32
ECDSA host key for 52.89.66.113 has changed and you have requested strict checking.
Host key verification failed.

注意:我的本地计算机是Windows,远程计算机是Windows,那么/home/Greg/.ssh/known_hosts是什么?远程上没有帐户Greg,只有管理员.本地框上有c:/Users/Greg帐户.在其中有.ssh.但是,由于没有"known_hosts"文件.

Note: my local box is Windows, the remote box is Windows so what is /home/Greg/.ssh/known_hosts? There is no account Greg on the remote, only Administrator. There is c:/Users/Greg account on local box. In that there is .ssh. But in that there is no "known_hosts" file.

我已经打开了远程防火墙上的TCP端口22.

I've opened TCP port 22 on the remote firewall.

我已经搜索了该错误,并看到了有关使用keygen修复该错误的信息,但不知道他们是否在谈论在本地盒或远程盒上运行它.真令人困惑!

I've googled the error and see stuff about fixing it with keygen but have no idea if they are talking about running it on the local box or remote box. All so confusing!

解决方案: 好的,我克服了这个问题,现在转到下一个问题.我做了什么以前,我可以从dos外壳将SSH放入远程计算机,因为我的PATH环境变量指向我的%CYGWIN%/bin目录.这很方便,但是也混淆了/home/Greg的位置.因此,我拿出了一个单独的Cygwin外壳,并从那里运行了ssh.然后,它给了我一条消息,提示无法创建目录home/Greg目录.啊哈!因此,我手动创建了它,并在其中创建了.ssh文件夹.然后我再次运行ssh命令,这一次它在.ssh文件夹中创建了"known_hosts"文件,然后它实际上已连接!

SOLUTION: Ok, I got past that problem, now onto the next. What did I do? I had previously been able to ssh into remote machines from a dos shell because I had the PATH environment variable pointing to my %CYGWIN%/bin directory. That's handy but it also obfuscated where /home/Greg was located. So I brought up a separate cygwin shell and ran the ssh from there. Then it gave me a message something about not being able to create directory home/Greg directory. Ah ha! So I created it manually, and the .ssh folder inside that. Then I ran the ssh command again and this time it created the "known_hosts" file in the .ssh folder and then it actually connected!

顺便说一句,然后我搜索了"known_hosts",并在c:/cygwin/home/Greg/.ssh中找到了它.另一个啊哈!!

BTW, I then did a search for "known_hosts" and found it in c:/cygwin/home/Greg/.ssh Another ah ha moment!

不幸的是,现在它不接受密码.我不确定要输入哪个密码?当我在远程上设置cygwin/sshd时,我在运行ssh-host-config命令时创建了一个密码.那是它想要的吗?我尝试过,但它不接受.我假设它想要的那个与启动AWS实例时创建的那个相同,我用来将桌面远程插入该实例的那个.但是它也不接受那个.嘘,为什么这么难!

Unfortunately, now its not accepting the password. I'm not sure which password its asking for? When I set up cygwin/sshd on the remote, I had created a password when I ran the ssh-host-config command. Is that the one it wants? I tried it but it didn't accept it. I assume the one it wants is the same one that was created when the AWS instance was launched, the same one I use to remote desktop into the instance. But it didn't accept that one either. Sheesh, why is this so hard!

推荐答案

我克服了这个问题.我做了什么以前,我可以从dos外壳将ssh放入远程计算机,因为我的PATH环境变量指向我的%CYGWIN%/bin目录.这很方便,但是也混淆了/home/Greg的位置.因此,我拿出了一个单独的Cygwin外壳,并从那里运行了ssh.然后,它给了我一条消息,提示无法创建目录home/Greg目录.啊哈!因此,我手动创建了它,并在其中创建了.ssh文件夹.然后我再次运行ssh命令,这一次它在.ssh文件夹中创建了"known_hosts"文件,然后它实际上已连接!

I got past that problem. What did I do? I had previously been able to ssh into remote machines from a dos shell because I had the PATH environment variable pointing to my %CYGWIN%/bin directory. That's handy but it also obfuscated where /home/Greg was located. So I brought up a separate cygwin shell and ran the ssh from there. Then it gave me a message something about not being able to create directory home/Greg directory. Ah ha! So I created it manually, and the .ssh folder inside that. Then I ran the ssh command again and this time it created the "known_hosts" file in the .ssh folder and then it actually connected!

顺便说一句,然后我搜索了"known_hosts",并在c:/cygwin/home/Greg/.ssh中找到了它.另一个啊哈!!

BTW, I then did a search for "known_hosts" and found it in c:/cygwin/home/Greg/.ssh Another ah ha moment!

这篇关于无法使用cygwin ssh SSH到AWS Windows实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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