В современных версиях Windows уже есть встроенный SSH сервер на базе пакета OpenSSH. В этой статье мы покажем, как установить и настроить OpenSSH сервер в Windows 10/11 и Windows Server 2022/2019 и подключиться к нему удаленно по защищенному SSH протоколу (как к Linux).
Содержание:
- Установка сервера OpenSSH в Windows
- Настройка SSH сервера в Windows
- Sshd_config: Конфигурационный файл сервера OpenSSH
- Подключение по SSH к Windows компьютеру
- Логи SSH подключений в Windows
Установка сервера OpenSSH в Windows
Пакет OpenSSH Server включен в современные версии Windows 10 (начиная с 1803), Windows 11 и Windows Server 2022/2019 в виде Feature on Demand (FoD). Для установки сервера OpenSSH достаточно выполнить PowerShell команду:
Get-WindowsCapability -Online | Where-Object Name -like ‘OpenSSH.Server*’ | Add-WindowsCapability –Online
Или при помощи команды DISM:
dism /Online /Add-Capability /CapabilityName:OpenSSH.Server~~~~0.0.1.0
Если ваш компьютер подключен к интернету, пакет OpenSSH.Server будет скачан и установлен в Windows.
Также вы можете установить сервер OpenSSH в Windows через современную панель Параметры (Settings -> Apps and features -> Optional features -> Add a feature, Приложения -> Управление дополнительными компонентами -> Добавить компонент. Найдите в списке OpenSSH Server и нажмите кнопку Install).
На изолированных от интернета компьютерах вы можете установить компонент с ISO образа Features On Demand (доступен в личном кабинете на сайте Microsoft: MSDN или my.visualstudio.com). Скачайте диск, извлеките его содержимое в папку c:\FOD (достаточно распаковать извлечь файл
OpenSSH-Server-Package~31bf3856ad364e35~amd64~~.cab
), выполните установку из локального репозитория:
Add-WindowsCapability -Name OpenSSH.Server~~~~0.0.1.0 -Online -Source c:\FOD
Также доступен MSI установщик OpenSSH для Windows в официальном репозитории Microsoft на GitHub (https://github.com/PowerShell/Win32-OpenSSH/releases/). Например, для Windows 10 x64 нужно скачать и установить пакет OpenSSH-Win64-v8.9.1.0.msi. Следующая PowerShell команда скачает MSI файл и установит клиент и сервер OpenSSH:
Invoke-WebRequest https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.9.1.0p1-Beta/OpenSSH-Win64-v8.9.1.0.msi -OutFile $HOME\Downloads\OpenSSH-Win64-v8.9.1.0.msi -UseBasicParsing
msiexec /i c:\users\root\downloads\OpenSSH-Win64-v8.9.1.0.msi
Также вы можете вручную установить OpenSSH сервер в предыдущих версиях Windows (Windows 8.1, Windows Server 2016/2012R2). Пример установки Win32-OpenSSH есть в статье “Настройка SFTP сервера (SSH FTP) в Windows”.
Чтобы проверить, что OpenSSH сервер установлен, выполните:
Get-WindowsCapability -Online | ? Name -like 'OpenSSH.Ser*'
State : Installed
Настройка SSH сервера в Windows
После установки сервера OpenSSH в Windows добавляются две службы:
- ssh-agent (OpenSSH Authentication Agent) – можно использовать для управления закрытыми ключами если вы настроили SSH аутентификацию по ключам;
- sshd (OpenSSH SSH Server) – собственно сам SSH сервер.
Вам нужно изменить тип запуска службы sshd на автоматический и запустить службу с помощью PowerShell:
Set-Service -Name sshd -StartupType 'Automatic'
Start-Service sshd
С помощью nestat убедитесь, что теперь в системе запущен SSH сервер и ждет подключений на порту TCP:22 :
netstat -na| find ":22"
Проверьте, что включено правило брандмауэра (Windows Defender Firewall), разрешающее входящие подключения к Windows по порту TCP/22.
Get-NetFirewallRule -Name *OpenSSH-Server* |select Name, DisplayName, Description, Enabled
Name DisplayName Description Enabled ---- ----------- ----------- ------- OpenSSH-Server-In-TCP OpenSSH SSH Server (sshd) Inbound rule for OpenSSH SSH Server (sshd) True
Если правило отключено (состоянии Enabled=False) или отсутствует, вы можете создать новое входящее правило командой New-NetFirewallRule:
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Рассмотрим, где храниться основные компоненты OpenSSH:
- Исполняемые файлы OpenSSH Server находятся в каталоге
C:\Windows\System32\OpenSSH\
(sshd.exe, ssh.exe, ssh-keygen.exe, sftp.exe и т.д.) - Конфигурационный файл sshd_config (создается после первого запуска службы):
C:\ProgramData\ssh
- Файлы authorized_keys и ssh ключи можно хранить в профиле пользователей:
%USERPROFILE%\.ssh\
Sshd_config: Конфигурационный файл сервера OpenSSH
Настройки сервере OpenSSH хранятся в конфигурационном файле %programdata%\ssh\sshd_config. Это обычный текстовый файл с набором директив. Для редактирования можно использовать любой текстовый редактор (я предпочитаю notepad++). Можно открыть с помощью обычного блокнота:
start-process notepad C:\Programdata\ssh\sshd_config
Например, чтобы запретить SSH подключение для определенного доменного пользователя (и всех пользователей указанного домена), добавьте в конце файле директивы:
DenyUsers winitpro\[email protected] DenyUsers corp\*
Чтобы разрешить подключение только для определенной доменной группы:
AllowGroups winitpro\sshadmins
Либо можете разрешить доступ для локальной группы:
AllowGroups sshadmins
По умолчанию могут к openssh могут подключаться все пользователи Windows. Директивы обрабатываются в следующем порядке: DenyUsers, AllowUsers, DenyGroups,AllowGroups.
Можно запретить вход под учетными записями с правами администратора, в этом случае для выполнения привилегированных действий в SSH сессии нужно делать runas.
DenyGroups Administrators
Следующие директивы разрешают SSH доступ по ключам (SSH аутентификации в Windows с помощью ключей описана в отдельной статье) и по паролю:
PubkeyAuthentication yes PasswordAuthentication yes
Вы можете изменить стандартный SSH порт TCP/22, на котором принимает подключения OpenSSH в конфигурационном файле sshd_config в директиве Port.
После любых изменений в конфигурационном файле sshd_config нужно перезапускать службу sshd:
restart-service sshd
Подключение по SSH к Windows компьютеру
Теперь вы можете попробовать подключиться к своей Windows 10 через SSH клиент (в этом примере я использую putty).
Вы можете использовать встроенный SSH клиентом Windows для подключения к удаленному хосту. Для этого нужно в командной строке выполнить команду:
ssh [email protected]
В этом примере
alexbel
– имя пользователя на удаленном Windows компьютере, и 192.168.31.102 – IP адрес или DNS имя компьютера.
Обратите внимание что можно использовать следующие форматы имен пользователей Windows при подключении через SSH:
-
alex@server1
– локальный пользователь Windows -
[email protected]@server1
–пользователь Active Directory (в виде UPN) или аккаунт Microsoft/ Azure(Microsoft 365) -
winitpro\alex@server1
– NetBIOS формат имени
В домене Active Directory можно использовать Kerberos аутентификацию в SSH. Для этого в sshd_config нужно включить параметр:
GSSAPIAuthentication yes
После этого можно прозрачно подключать к SSH сервер с Windows компьютера в домене из сессии доменного подключается. В этом случае пароль пользователя не указывается и выполняется SSO аутентификация через Kerberos:
ssh -K server1
При первом подключении появится стандартный запрос на добавление узла в список известных SSH хостов.
Нажимаем Да, и в открывшееся окне авторизуемся под пользователем Windows.
При успешном подключении запускается командная оболочка cmd.exe со строкой-приглашением.
admin@win10tst C:\Users\admin>
В командной строке вы можете выполнять различные команды, запускать скрипты и программы.
Я предпочитаю работать в командной строке PowerShell. Чтобы запустить интерпретатор PowerShell, выполните:
powershell.exe
Чтобы изменить командную оболочку (Shell) по умолчанию в OpenSSH с cmd.exe на PowerShell, внесите изменение в реестр такой командой:
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String –Force
Осталось перезапустить SSH подключение и убедиться, что при подключении используется командный интерпретатор PowerShell (об этом свидетельствует приглашение
PS C:\Users\admin>
).
В SSH сессии запустилась командная строка PowerShell, в которой работают привычные функции: авто дополнение, раскраска модулем PSReadLine, история команд и т.д. Если текущий пользователь входит в группу локальных администраторов, то все команды в его сессии выполняются с повышенными правами даже при включенном UAC.
Логи SSH подключений в Windows
В Windows логи подключений к SSH серверу по-умолчанию пишутся не в текстовые файлы, а в отдельный журнал событий через Event Tracing for Windows (ETW). Откройте консоль Event Viewer (
eventvwr.msc
>) и перейдите в раздел Application and services logs -> OpenSSH -> Operational.
При успешном подключении с помощью к SSH серверу с помощью пароля в журнале появится событие:
EventID: 4 sshd: Accepted password for root from 192.168.31.53 port 65479 ssh2
Если была выполнена аутентификация с помощью SSH ключа, событие будет выглядеть так:
sshd: Accepted publickey for locadm from 192.168.31.53 port 55772 ssh2: ED25519 SHA256:FEHDEC/J72Fb2zC2oJNb45678967kghH43h3bBl31ldPs
Если вы хотите, чтобы логи писались в локальный текстовый файл, нужно в файле sshd_config включить параметры:
SyslogFacility LOCAL0 LogLevel INFO
Перезапустите службу sshd и провеьте, что теперь логи SSH сервера пишутся в файл C:\ProgramData\ssh\logs\sshd.log
SSH servers for Windows
SSH (Secure SHell) is a network protocol that covers authentication, encryption and the integrity of data transmitted over a network. Below is a quote from Wikipedia:
Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. Used primarily on Linux and Unix based systems to access shell accounts, SSH was designed as a replacement for Telnet and other insecure remote shells, which send information, notably passwords, in plaintext, leaving them open for interception. The encryption used by SSH provides confidentiality and integrity of data over an insecure network, such as the Internet.
SSH protocol has client/server architecture. An SSH server program accepts or rejects incoming connections. This article covers the most used SSH servers for Windows.
OpenSSH for Windows
Homepage | Downloads
This implementation basically wraps Cygwin’s OpenSSH port in a package that includes a standard Windows installation program that provides full SSH/SCP/SFTP support. SSH terminal support provides a familiar Windows Command prompt, while retaining Unix/Cygwin-style paths for SCP and SFTP.
freeSSHd and freeFTPd
Homepage | Download
freeSSHd, like it’s name says, is a free implementation of an SSH server. It provides strong encryption and authentication over insecure networks like Internet. Users can open remote console or even access their remote files thanks to buit-in SFTP server
KTS (KpyM Telnet/SSH Server)
Homepage | Download
KpyM Telnet/SSH Server is free, open source telnet and ssh server for Windows 2000/2003/XP/Vista. KTS provides access to the host computer via telnet or ssh protocol. It allows you to run remotely your command line applications (dir, ftp, etc.) and full colour console graphic applications (sapconsole.exe, edit.com, tetris.exe, etc.). KTS accepts connection from any telnet/ssh client running on any OS. It runs as a service and uses the native Windows identification mechanism, thus no additional user names and passwords are stored. Includes an automated install/uninstall program and a console setup.
WinSSHD
Homepage | Download
WinSSHD is SSH server from Bitwise for all Windows NT-series operating systems. It is easy to install and configure. In a regular Windows environment, it will work immediately upon installation with no configuring. WinSSHD can be used free of charge by non-commercial personal users.
copSSH
Homepage | Download
copSSH is an ssh server and client implementation for Windows systems. It is a yet another packaging of portable openssh, cygwin, some popular utilites, plus implementation of some best practices regarding security. You can use copssh for remote administration of your systems or gathering remote information in a secure way
MobaSSH Home
Homepage | Download
MobaSSH allows you to run commands and transfer files on a remote Windows PC from any operating system through a fully secured and encrypted network connection. This SSH server is 100% compatible with the Linux/Unix/HPUx/AIX SSH clients, but also with Putty or WinSCP on Windows. MobaSSH Home is very simple: after downloading the installer, you can configure and start SSH server on your Windows PC in a single click!
Sysax Multi Server
Homepage | Download
Sysax Multi Server is a Secure FTP Server and SSH2 Secure Shell Server combined into a single product. It simultaneously supports remote access and file transfer using FTP, FTPS, SFTP, Telnet, and Secure Shell. It also supports web based file transfer using HTTP and HTTPS. The interface is very user friendly and easy to setup. This SSH server is currently used by fortune 1000 companies, educational institutions, non profit organizations, and many small businesses worldwide.
Installs both Personal Edition, free for personal and non-commercial use, or Standard Edition — 30-day evaluation with full functionality. Excellent terminal. Single virtual filesystem for SFTP, SCP, and terminal (when using BvShell) with multiple configurable mount points. Cryptography FIPS 140-2 compliant if enabled in Windows. Supports the latest Windows server and desktop versions, both 32-bit and 64-bit. Requires at least Windows XP SP3, Windows Server 2003, or newer.
The link is to Amazon CloudFront and should be very reliable. If it does not work, try alternative.
If the installer downloads but does not start, check below.
Our installers are cryptographically signed. Our most recent installers use an Extended Validation digital certificate from DigiCert. Here is how to verify. Do not run installers for Bitvise software that do not carry a valid digital signature by Bitvise.
Bitvise SSH Server is easy to uninstall.
Using Bitvise SSH Server requires you to read and agree with its License Terms.
Bitvise software does not contain ads, install product bundles or collect user data for sale. We are 100% supported by users who license our software. Thank you!
Upgrading from a previous version
To upgrade from a previous version, download the new installer, execute it, and follow the process. The installer will detect an existing installation and will automatically remove it before installing the new one. During this process, your settings will be preserved.
Upgrade access
Each Bitvise SSH Server license comes with 12 months of access to new versions included free of charge. Additional upgrade access can be purchased either with the initial license, or subsequently.
If your upgrade access has expired, you will need to purchase one or more license-years of upgrade access to get a new activation code. You can do this through your License Overview. The cost is $19.95 per SSH Server license and per year.
Help! The installer does not start?
Depending on your Windows version, security settings, and how the installer was downloaded, you may need to take an extra step to start it. On Windows Server 2016, right-click the installer executable in Windows Explorer, click Properties, and see if you need to check Unblock on the General tab.
by GoodTech Systems
New server provided for Windows processor
Operating system: Windows
Publisher:
GoodTech Systems
Antivirus check: passed
Report a Problem
SSH Server — a server that allows remote access to the computer on which it is installed. SSH Server allows you to transfer files over SFTP and SCP protocols, perform port forwarding (TCP/IP tunneling) and, thanks to the use of Cryptlib cryptographic library, provides a high level of connection security. SSH Server users can run the program on a remote host computer, send commands via Telnet, connect to the server using any standard SSH clients (OpenSSH, PUTTY, F-Secure, etc.). With this program you can remotely manage corporate servers (web servers, mail servers, database servers, etc.) and allocate server resources between multiple users (for example, instead of running an application on a local computer, you, like other authorized users, can run it on a remote server).
In addition, SSH Server allows you to edit files remotely, run scripts on the server and transfer files from the local network to the Internet and back. In its work, the server uses SSH2 standards and allows you to use many cryptographic algorithms (Blowfish, RC4, IDEA, etc.). The administrator of a server has possibility to limit access to it on names of hosts and IP addresses, to operate access of users to folders and files on a server, and also to operate services started on it and active user sessions.
The main benefit of using SSH Server software is its ability to remotely manage and securely transfer files between servers and clients.
— remote computer control;
— allocation of server resources among users;
— a high level of security;
— full control over access to server resources.
Highly secure data transmission due to advanced encryption protocols.
Allows remote control of systems, boosting efficiency and flexibility.
Supports multiple authentication methods, enhancing security.
Can be complex to configure for less experienced users.
Potential security risks if not properly maintained and updated.
Limited support for some older or less common operating systems.
👨💻️ USER REVIEWS AND COMMENTS 💬
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
Thomas
This SSH Server is very ideal for file transfer, over SFP and SCP protocols. You can also perform port forwarding in TCP/ IP tunnelling. Thanks to the Cryptlib cryptographic library, it offers high level of connection security. Users can run the program on a remote host computer. You can also edit files.
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
David
The RadiAnt Viewer is an extremely fast software tool for viewing your patient’s CD’s. It does not require installation. You can change the logo information and customize it with your office’s logo and information. It will also run on computers with only 512 MB of RAM. You can retrieve information and do searches from PACS locations. Information from many different imaging types are supported including radiography, mammography, tomography and others. Your DICOM files can be used to create presentations and publications. With its many tools such as multiplanar reconstruction and 3D volume rendering, the RadiAnt DICOM Viewer is an valuable tool for medical professionals.
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
Thomas
this software seems to be a great alternative to adobe acrobat. the software is designed to view djvu files easily. the software is easy to download,and one inside,shows to be easily maneuverable even for the beginner user. whether you are an advanced user looking for a different option, or someone just starting out, this would be a great product to try .best of all, it’s free to download
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
Kieran C*****u
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
Oscar C********e
I have been using the SSH Server software for a couple of months and I have found it to be reliable, secure and easy to use. The setup was straightforward, and I found the GUI to be intuitive. It’s also a great value for money, as the cost of the software is very reasonable. The documentation and support are excellent and they have been quick to respond when I had an issue. I’ve been able to configure it to meet my needs, and I haven’t had any major issues with it so far. I am very impressed with this product and I am very pleased with the results.
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
Logan Arp
I’ve been using the SSH Server softwre for a few weeks now and it’s been great so far, no issues that I’ve encoutnered so fare.
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
David J*********h
The most important feature of SSH Server software is its ability to securely provide remote access.
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
Samuel R*****o
SSH Server software is a tool that allows secure remote access to a computer system through a network. It provides a secure and encrypted connection between a client and a server, ensuring that all data transmitted between them is protected. This software enables users to remotely access a server and perform various tasks such as file transfers, remote command execution, and server administration. It also supports key-based authentication and access control, allowing administrators to manage user permissions and restrict access to specific resources. Additionally, SSH Server software offers advanced security features such as TCP forwarding, X11 forwarding, and port forwarding.
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
Lewis Uhlenbrock
SSH Server software is a secure and reliable tool for remotely accessing and managing servers.
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
Dylan
Configuring settings can be complex, but once established, connection is seamless and secure.
image/svg+xmlBotttsPablo Stanleyhttps://bottts.com/Florian Körner
Sean
Secure, reliable for remote administration. Configuration can be complex.
Query builder for combining building types
Tool kid for managing operating system
Editor used for videos for windows
Allows for the hosting of the station on Windows
IT BRINGS TO POPULAR EDITING FEATURES FOUND IN DESKTOP WORD PROCESSORS
Description
freeSSHd is a versatile freeware software offering a comprehensive suite of server functionalities, including SSH, Telnet, and SFTP server support. With capabilities for both password and public key authentication, this software ensures secure and flexible access to your server environment.
freeSSHd also boasts robust features such as logging, a variety of encryption ciphers (AES, 3DES, Blowfish etc), and more. Whether you need a reliable Telnet/SSH server or seek efficient SFTP file transfers, freeSSHd delivers a powerful set of features via its user-friendly GUI.
Version: 1.3.1