【转】Install Win32 OpenSSH (test release)

Openssh download url:https://github.com/PowerShell/Win32-OpenSSH/releases

Install instruction:

Install Win32 OpenSSH (test release)

  1. Note these considerations and project scope first.

  2. Download the latest build of OpenSSH. To get links to latest downloads this wiki page.

  3. Extract contents of the latest build to C:\Program Files\OpenSSH (Make sure binary location has the Write permissions to just to SYSTEM, Administrator groups. Authenticated users should and only have Read and Execute.)

  4. In an elevated Powershell console, run the following

    • powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
  5. Open the firewall for sshd.exe to allow inbound SSH connections

    • New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22

    Note: New-NetFirewallRule is for Windows 2012 and above servers only. If you're on a client desktop machine (like Windows 10) or Windows 2008 R2 and below, try:

    netsh advfirewall firewall add rule name=sshd dir=in action=allow protocol=TCP localport=22
    
  6. Start sshd (this will automatically generate host keys under %programdata%\ssh if they don't already exist)

    • net start sshd
  7. Optional

    • To configure a default shell, see here
    • To setup sshd service to auto-start
      • Set-Service sshd -StartupType Automatic
    • To migrate sshd configuration from older versions (0.0.X.X), see here

Uninstall Win32 OpenSSH

  • Start Windows Powershell as Administrator
  • Navigate to the OpenSSH directory
    • cd 'C:\Program Files\OpenSSH'
  • Run the uninstall script
    • powershell.exe -ExecutionPolicy Bypass -File uninstall-sshd.ps1
 

https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH

转载于:https://www.cnblogs.com/keepSmile/p/10664053.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值