Installing SFTP/SSH Server on Windows using OpenSSH

本文介绍了如何在不同版本的Windows上安装SFTP/SSH服务器,包括从设置应用中启用内置的OpenSSH服务器功能,以及手动下载并配置较新版本的OpenSSH。还提供了设置防火墙规则和自动启动服务的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Installing SFTP/SSH Server

1. On Windows 10 version 1803 and newer


In Settings app, go to Apps > Apps & features > Manage optional features.
Locate “OpenSSH server” feature, expand it, and select Install.
Binaries are installed to %WINDIR%\System32\OpenSSH. Configuration file (sshd_config) and host keys are installed to %ProgramData%\ssh (only after the server is started for the first time).

You may still want to use the following manual installation, if you want to install a newer version of OpenSSH than the one built into Windows 10.

 

2. On earlier versions of Windows

 

Download the latest OpenSSH for Windows binaries (package OpenSSH-Win64.zip or OpenSSH-Win32.zip)
As the Administrator, extract the package to C:\Program Files\OpenSSH
As the Administrator, install sshd and ssh-agent services:
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1


Configuring SSH server

 

  • Allow incoming connections to SSH server in Windows Firewall:
  • 1. Either run the following PowerShell command (Windows 8 and 2012 or newer only), as the Administrator: 

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

  2. or go to Control Panel > System and Security > Windows Firewall1 > Advanced Settings > Inbound Rules and add a new rule for port 22.

  • Start the service and/or configure automatic start:
  1. Go to Control Panel > System and Security > Administrative Tools and open Services. Locate OpenSSH SSH Server service.
  2. If you want the server to start automatically when your machine is started: Go to Action > Properties. In the Properties dialog, change Startup type to Automatic and confirm.
  3. Start the OpenSSH SSH Server service by clicking the Start the service.

 

转载于:https://www.cnblogs.com/xingfuxiaokong/p/11466357.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值