
OpenSSH-Win64.zip
5星
- 浏览量: 0
- 大小:None
- 文件类型:ZIP
简介:
OpenSSH-Win64.zip 是一个适用于Windows 64位操作系统的压缩文件,内含OpenSSH软件包,用于在Windows系统中提供安全的远程登录、文件传输等网络服务功能。
下载OpenSSH-Win64.zip并解压到C:\OpenSSH。
# 安装
打开命令提示符或PowerShell,并执行以下步骤:
1. 切换到安装目录:
```
cd C:\OpenSSH
```
2. 运行安装脚本:
```
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
```
# 开通防火墙规则
根据你的Windows版本,执行相应的命令:
对于 Windows 2012 及以上版本:
```
New-NetFirewallRule -Name sshd -DisplayName OpenSSH Server (sshd) -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
```
对于 Windows 2008 版本:
```
netsh advfirewall firewall add rule name=sshd dir=in action=allow protocol=TCP localport=22
```
# 启动服务
1. 启动SSH服务:
```
net start sshd
```
2. 设置 SSH 服务自动启动:
```
Set-Service sshd -StartupType Automatic
```
强烈建议将SSH连接的shell设置为PowerShell,而非默认的cmd。执行以下命令:
```
New-ItemProperty -Path HKLM:SOFTWARE\OpenSSH -Name DefaultShell -Value C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PropertyType String -Force
New-ItemProperty -Path HKLM:SOFTWARE\OpenSSH -Name DefaultShellCommandOption -Value c -PropertyType String -Force
```
推荐将PowerShell升级到4.0。
全部评论 (0)


