连接到 Windows SSH 服务器

发布于 2024-10-09 15:49:44 字数 559 浏览 5 评论 0原文

我是一个尝试 SSH 的新手。场景是我有 2 台机器 - Windows 7 PC(桌面)和 VMWare 机器(Windows 7)。两者都安装了 Cygwin。我正在尝试将 VMWare 计算机连接到桌面。我已经在桌面服务器上安装了 OpenSSH 服务器。我使用 netstat 验证它正在运行。 我修改了 Windows 防火墙,添加了入站规则以允许端口 22 的连接。

我的问题是我无法从 VMWare 计算机进行连接。

$ ssh -v user_name@my_machine
OpenSSH_5.5p1, OpenSSL 0.9.8q 2 Dec 2010
debug1: Connecting to my_machine port 22.
debug1: connect to address my_machine port 22: Connection refused
ssh: connect to host my_machine port 22: Connection refused

我做错了什么?我可以选择哪些配置?任何链接或答案都会有帮助。

谢谢。

WM

I am a newbie trying out SSH. The scenario is I have 2 machines - Windows 7 PC(Desktop) and a VMWare machine (Windows 7). Cygwin installed on both. I am trying to connect the VMWare machine to the desktop. I have installed the OpenSSH server on Desktop server. I verified it is running, using netstat.
I modified the Windows firewall, by adding to the Inbound Rules to allow connections for port 22.

My problem is I am unable to connect from the VMWare machine.

$ ssh -v user_name@my_machine
OpenSSH_5.5p1, OpenSSL 0.9.8q 2 Dec 2010
debug1: Connecting to my_machine port 22.
debug1: connect to address my_machine port 22: Connection refused
ssh: connect to host my_machine port 22: Connection refused

What am I doing wrong? What are my options to configure? Any links or answers would be helpful.

Thank you.

WM

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

诺曦 2024-10-16 15:49:44

打开命令提示符并运行以下命令:
ssh -v Your_User_Name@Your_IP_Address

如果响应是:
OpenSSH_for_Windows_7.7p1、LibreSSL 2.6.5
debug1:连接到 Your_IP_Address 端口 22。
debug1:连接到地址 Your_IP_Address 端口 22:连接被拒绝
ssh: 连接到主机 Your_IP_Address 端口 22: 连接被拒绝

然后转到名为 OpenSSH 的 Windows 服务 SSH 服务器已启动并运行,默认设置为手动启动,因此除非您启动它,否则它不会运行。

现在再次运行上面的命令。 SSH 命令将连接到用户。

Open your command prompt and run the following command:
ssh -v Your_User_Name@Your_IP_Address

If response is:
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Connecting to Your_IP_Address port 22.
debug1: connect to address Your_IP_Address port 22: Connection refused
ssh: connect to host Your_IP_Address port 22: Connection refused

Then go to the Windows Service called OpenSSH SSH Server is started and running, it is set to manual start as default so it will not be running unless you have started it.

Now run above command again. SSH command will connect to the user.

情深缘浅 2024-10-16 15:49:44

您应该确保 my_machine 允许入站连接。检查防火墙...

(如果您可以在本地运行此命令 - 但不能从其他计算机运行,则可能是这种情况)。

You should make sure that my_machine allows inbound connection. Check the firewall....

(if you can run this command locally - but not from the other machine it might be that case).

情感失落者 2024-10-16 15:49:44

如果可以在本地主机中访问桌面上的 ssh 服务器,请尝试此

桌面 <- 桌面防火墙 <- 虚拟机防火墙 <- 虚拟机

尝试逐个关闭之间的防火墙以检查问题从哪里开始,然后进行相应配置。请记住,桌面防火墙规则应为入站规则,而虚拟机防火墙规则应为出站规则

If the ssh server on the Desktop is accessible in the localhost then try this

Desktop <- Desktop Firewall <- VM Firewall <- VM

Try shutting down the firewalls in between one by one to check where the issue starts after then configure accordingly. Remember that the Desktop Firewall rules should be inbound and the VM Firewall is outbound

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文