【发布时间】:2021-04-15 19:15:54
【问题描述】:
我一直在尝试通过 OpenSSH 协议无需密码即可访问 Windows Server 2019。 所以我创建了新的密钥,我需要将它复制到 Windows Server,我试过这个:
ssh-copy-id -i ~/.ssh/id_rsa user@server
但输入正确密码后我得到了这个:
'exec' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
The system cannot find the path specified.
我的问题是如何从一台 Windows 机器传输密钥(使用 gitbash、WSL、powershell 或其他) 如果我没记错的话,到 Windows Server 2019 的授权密钥位置。
我迫切需要手动完成,但这些密钥的位置对我来说是个谜,我是否需要先在 Windows Server 上设置一些东西以便它可以接受用于身份验证的密钥?
ssh-copy-id 从 Windows 机器到 Windows Server 2019 的替代方法是什么?
找到解决方案: 遵循这个有用的 youtube 指南,支持 https://www.youtube.com/watch?v=Cs3wBl_mMH0&ab_channel=IT%2FOpsTalk-Deprecated-SeeChannelDescription
此外,安装 OpenSSHUtils 可以使用:
Install-Module -Name OpenSSHUtils -RequiredVersion 0.0.2.0 -Scope AllUsers
本指南也有帮助:
https://www.cloudsma.com/2018/03/installing-powershell-modules-on/
我的服务器没有访问权限,所以我手动从以下位置复制了文件: C:\Program Files\WindowsPowerShell\Modules 到服务器的: 服务器:\Program Files\WindowsPowerShell\Modules
【问题讨论】:
标签: ssh server openssh windows-server