AFFGT
点滴价值

Windows server 2019 安装ssh server-Windows server 2019 install ssh server

Windows Server 2019 原生支持 OpenSSH Server 远程管理

1、安装server和client,client是默认已经安装的。

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

2、设置自启动

Set-Service sshd -StartupType Automatic
Set-Service ssh-agent -StartupType Automatic

3、启动服务

Start-Service sshd
Start-Service ssh-agent

4、其它问题,在某些服务器上ssh server使用上面的命令会安装失败。据说是Windows server自身问题,可以安装补丁包解决。也可以敲一下命令试试。

dism /Add-Capability /CapabilityName:OpenSSH.Client~~~~0.0.1.0 /LimitAccess  /Online

问题log:
Get-WindowsCapability : Get-WindowsCapability failed. Error code = 0x800f0950
At line:1 char:1
+ Get-WindowsCapability -Online | ? Name -like 'xxxx'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-WindowsCapability], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsCapabilityCommand

5、其它

相关问题收录:
https://social.technet.microsoft.com/Forums/en-US/c3550346-0216-492b-9fc0-689c67ac56ed/server-2019-technical-preview-getwindowscapability-problems?forum=WinServerPreview
https://github.com/MicrosoftDocs/windowsserverdocs/issues/2074
官网教程:
https://techcommunity.microsoft.com/t5/ITOps-Talk-Blog/Installing-and-Configuring-OpenSSH-on-Windows-Server-2019/ba-p/309540

赞(0) 打赏
未经允许不得转载:AffGoTo » Windows server 2019 安装ssh server-Windows server 2019 install ssh server

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏