在 Linux 中使用 SSH 连接到 Windows 操作系统

在 Linux 中使用 SSH 连接到 Windows 操作系统

在 Windows 计算机中,我在 Oracle VM VirtualBox 中安装了 Ubuntu。

在 Ubuntu 中,如果我想连接到另一台 Linux 机器:

$ ssh username@ip

但如果我想连接到我的 Windows 机器,这种方法就行不通了!

那么我如何使用sshUbuntu 连接到 Windows 机器(即在我的虚拟机 virtualBox 中)?

@bodhi.zazen 谢谢你的回答。我openssh在Windows下安装后,使用时ssh username@ip出现以下错误:

root@lime-VirtualBox:/home/lime# ssh [email protected]

                        ****USAGE WARNING****

This is a private computer system. This computer system, including all
related equipment, networks, and network devices (specifically including
Internet access) are provided only for authorized use. This computer system
may be monitored for all lawful purposes, including to ensure that its use
is authorized, for management of the system, to facilitate protection against
unauthorized access, and to verify security procedures, survivability, and
operational security. Monitoring includes active attacks by authorized entities
to test or verify the security of this system. During monitoring, information
may be examined, recorded, copied and used for authorized purposes. All
information, including personal information, placed or sent over this system
may be monitored.

Use of this computer system, authorized or unauthorized, constitutes consent
to monitoring of this system. Unauthorized use may subject you to criminal
prosecution. Evidence of unauthorized use collected during monitoring may be
used for administrative, criminal, or other adverse action. Use of this system
constitutes consent to monitoring for these purposes.


[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied (publickey,password,keyboard-interactive).

在我的 Windows 机器上,我重新编辑了C:\Program Files (x86)\OpenSSH for Window/etc/sshd_config这样的内容:

PermitRootLogin yes
PasswordAuthentication yes

但我仍然遇到同样的错误。

当我从 Windows 机器连接 Ubuntu 时ssh,出现错误

Permission denied (publickey,password,keyboard-interactive)

仍然存在。

答案1

同样的方法,但您需要在 Windows 计算机上运行 ssh 服务器(并确保您没有对连接设置防火墙)。

看 -https://stackoverflow.com/questions/18292/what-are-some-good-ssh-servers-for-windows

编辑:如果您需要 Windows ssh 客户端,请使用 PuTTy

http://www.chiark.greenend.org.uk/~sgtatham/putty/

答案2

Windows机器应该运行一些SSH服务器,例如我喜欢这个:freeSSHD(http://www.freesshd.com/),这符合我的需要。只是您必须尊重 Windows 风格的文件夹等。简单:您将进入 DOS 提示符。 freeSSHd 的其他功能将使您能够通过 SFTP 连接、通过 挂载 Windows 文件和文件夹到本地驱动器sshfs、管理允许的用户、管理访问密钥(如果需要),并且您可以简单地选择将 freeSSHd 作为服务运行,因此 Windows机器不必登录。

更新编辑

您是否在配置中允许了某些AllowUsers或AllowGroups?您是通过 Linux 根用户登录还是使用 Windows 用户/密码登录?不要忘记,您正在敌对的 Windows 环境中运行该软件。应允许该用户在 Windows 中运行某些操作,因此首先使用管理员帐户进行尝试。

相关内容