1、win10安装 OpenSSH

官网链接:https://docs.microsoft.com/zh-cn/windows-server/administration/openssh/openssh_install_firstuse

按住shift键,在某个目录点击鼠标右键,点击打开powershell

1、安装软件
# 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

2、启动软件
# Start the sshd service
Start-Service sshd

# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'

# Confirm the firewall rule is configured. It should be created automatically by setup.
Get-NetFirewallRule -Name *ssh*

# There should be a firewall rule named "OpenSSH-Server-In-TCP", which should be enabled
# If the firewall does not exist, create one
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22

3、卸载软件
# Uninstall the OpenSSH Client
Remove-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

# Uninstall the OpenSSH Server
Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
执行命令在里面

相关文章:

  • 2022-12-23
  • 2021-12-14
  • 2021-05-06
  • 2022-12-23
  • 2022-02-08
  • 2021-10-01
  • 2021-12-15
猜你喜欢
  • 2021-09-21
  • 2021-09-16
  • 2021-12-01
  • 2021-12-06
  • 2022-01-21
  • 2021-10-18
相关资源
相似解决方案