Windows 10 SSH 服务器安装不会创建所需的服务 [英] Windows 10 SSH server installation does not create required services
问题描述
我正在尝试在我的 Windows 10 电脑上安装 Open-SSH,以便使用 ssh 从我的 linux 机器连接到它.我正在关注 本教程,但是一旦我必须运行诸如 Start-Service ssh-agent
之类的东西,它就会说该服务不存在.另一件事是Install-Module -Force OpenSSHUtils
,它说文件'OpenSSHUtils.psd1'的签名无效.
我试过了许多其他教程,在每个教程之前都卸载了所有内容,但它们都不起作用.有没有办法手动安装这些东西?我是否遗漏了安装的一个重要步骤?
I am trying to install Open-SSH on my Windows 10 pc in order to connect to it from my linux machine with ssh. I am following this tutorial, but as soon as I have to run something like Start-Service ssh-agent
, it says that the service doesn't exist. Another thing that doesn't work is Install-Module -Force OpenSSHUtils
, and it says that the signature of the file 'OpenSSHUtils.psd1' is not valid.
I have tried many other tutorials, uninstalling everything before each one, and none of them are working. Is there any way to install these things manually? Am I missing an important step of the installation?
推荐答案
您知道可以使用添加功能"选项直接在 Windows 10 中安装 SSH,对吗?无需下载外部模块/工具,除非内置模块/工具无法满足您的所有需求.
You do know you can install SSH directly in Windows 10 by using Add Feature option, correct? No need to download an external module/tool unless the builtin one does not provide all you are after.
为 Windows Server 2019 和 Windows 10 安装 OpenSSH
# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
# Install the OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
使用图形用户界面
如何启用和使用 Windows 10 的新内置 SSH 命令
但是,如果您确实决定使用外部内容,那么在真正实施之前始终测试破坏性(CUD = 创建、更新、删除)代码.
Yet, if you do decide to use external stuff, then, Always test destructive (CUD = Create, Update, delete) code before true implementation.
Find-Module -Name 'OpenSSHUtils' -Verbose
<#
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='OpenSSHUtils'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'OpenSSHUtils'.
Version Name Repository Description
------- ---- ---------- -----------
1.0.0.1 OpenSSHUtils PSGallery Configure OpenSSH for Windows related security settings like file owner and permissions.
#>
Find-Module -Name 'OpenSSHUtils' -Verbose |
Save-Module -Path "$env:USERPROFILE\Documents\WindowsPowerShell\Modules" -Verbose -WhatIf
<#
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='OpenSSHUtils'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'OpenSSHUtils'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'PSGallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='OpenSSHUtils'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'OpenSSHUtils'.
What if: Performing the operation "Save Package" on target "'OpenSSHUtils' to location 'C:\Users\Daniel\Documents\WindowsPowerShell\Modules'".
#>
Install-Module -Name 'OpenSSHUtils' -Verbose -WhatIf
<#
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='OpenSSHUtils'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'OpenSSHUtils'.
What if: Performing the operation "Install-Module" on target "Version '1.0.0.1' of module 'OpenSSHUtils'".
#>
这篇关于Windows 10 SSH 服务器安装不会创建所需的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!