Как использовать ssh на windows 10

В Windows 10 и Windows Server 2019 появился встроенный SSH клиент, который вы можете использовать для подключения к *Nix серверам, ESXi хостам и другим устройствам по защищенному протоколу, вместо Putty, MTPuTTY или других сторонних SSH клиентов. Встроенный SSH клиент Windows основан на порте OpenSSH и предустановлен в ОС, начиная с Windows 10 1809.

Содержание:

  • Установка клиента OpenSSH в Windows 10
  • Как использовать SSH клиенте в Windows 10?
  • SCP: копирование файлов из/в Windows через SSH

Установка клиента OpenSSH в Windows 10

Клиент OpenSSH входит в состав Features on Demand Windows 10 (как и RSAT). Клиент SSH установлен по умолчанию в Windows Server 2019 и Windows 10 1809 и более новых билдах.

Проверьте, что SSH клиент установлен:

Get-WindowsCapability -Online | ? Name -like 'OpenSSH.Client*'

'OpenSSH.Client установка в windows 10

В нашем примере клиент OpenSSH установлен (статус: State: Installed).

Если SSH клиент отсутствует (State: Not Present), его можно установить:

  • С помощью команды PowerShell:
    Add-WindowsCapability -Online -Name OpenSSH.Client*
  • С помощью DISM:
    dism /Online /Add-Capability /CapabilityName:OpenSSH.Client~~~~0.0.1.0
  • Через Параметры -> Приложения -> Дополнительные возможности -> Добавить компонент. Найдите в списке Клиент OpenSSH и нажмите кнопку Установить.

клиент openssh установить компонент

]Бинарные файлы OpenSSH находятся в каталоге c:\windows\system32\OpenSSH\.

  • ssh.exe – это исполняемый файл клиента SSH;
  • scp.exe – утилита для копирования файлов в SSH сессии;
  • ssh-keygen.exe – утилита для генерации ключей аутентификации;
  • ssh-agent.exe – используется для управления ключами;
  • ssh-add.exe – добавление ключа в базу ssh-агента.

исполняемые файлы OpenSSH

Вы можете установить OpenSSH и в предыдущих версиях Windows – просто скачайте и установите Win32-OpenSSH с GitHub (есть пример в статье “Настройка SSH FTP в Windows”).

Как использовать SSH клиенте в Windows 10?

Чтобы запустить SSH клиент, запустите командную строку
PowerShell
или
cmd.exe
. Выведите доступные параметры и синтаксис утилиты ssh.exe, набрав команду:

ssh

usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file]
[-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
[-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
destination [command]

параметры ssh клиента в windows

Для подключения к удаленному серверу по SSH используется команда:

ssh username@host

Если SSH сервер запущен на нестандартном порту, отличном от TCP/22, можно указать номер порта:

ssh username@host -p port

Например, чтобы подключиться к Linux хосту с IP адресом 192.168.1.202 под root, выполните:

ssh [email protected]

При первом подключении появится запрос на добавление ключа хоста в доверенные, наберите yes -> Enter (при этом отпечаток ключа хоста добавляется в файл C:\Users\username\.ssh\known_hosts).

Затем появится запрос пароля указанной учетной записи, укажите пароль root, после чего должна открытся консоль удаленного Linux сервера (в моем примере на удаленном сервере установлен CentOS 8).

подключение из windows 10 в linux с помощью встроенного ssh клиента

С помощью SSH вы можете подключаться не только к *Nix подобным ОС, но и к Windows. В одной из предыдущих статей мы показали, как настроить OpenSSH сервер на Windows 10 и подключиться к нему с другого компьютера Windows с помощью SSH клиента.

Если вы используете SSH аутентификацию по RSA ключам (см. пример с настройкой SSH аутентификации по ключам в Windows), вы можете указать путь к файлу с закрытым ключом в клиенте SSH так:

ssh [email protected] -i "C:\Users\username\.ssh\id_rsa"

Также вы можете добавить ваш закрытый ключ в SSH-Agent. Сначала нужно включить службу ssh-agent и настроить ее автозапуск:

set-service ssh-agent StartupType ‘Automatic’
Start-Service ssh-agent

Добавим ваш закрытый ключ в базу ssh-agent:

ssh-add "C:\Users\username\.ssh\id_rsa"

Теперь вы можете подключиться к серверу по SSH без указания пути к RSA ключу, он будет использоваться автоматически. Пароль для подключения не запрашивается (если только вы не защитили ваш RSA ключ отдельным паролем):

ssh [email protected]

Еще несколько полезных аргументов SSH:

  • -C
    – сжимать трафик между клиентом и сервером (полезно на медленных и нестабильных подключениях);
  • -v
    – вывод подробной информации обо всех действия клиента ssh;
  • -R
    /
    -L
    – можно использовать для проброса портов через SSH туннель.

SCP: копирование файлов из/в Windows через SSH

С помощью утилиты scp.exe, которая входит в состав пакета клиента SSH, вы можете скопировать файл с вашего компьютера на SSH сервер:

scp.exe "E:\ISO\CentOS-8.1.1911-x86_64.iso" [email protected]:/home

scp.exe копирование файлов через ssh

Можно рекурсивно скопировать все содержимое каталога:

scp -r E:\ISO\ [email protected]:/home

И наоборот, вы можете скопировать файл с удаленного сервера на ваш компьютер:

scp.exe [email protected]:/home/CentOS-8.1.1911-x86_64.iso e:\tmp

Если вы настроите аутентификацию по RSA ключам, то при копировании файлов не будет появляться запрос на ввод пароля для подключения к SSH серверу. Это удобно, когда вам нужно настроить автоматическое копирование файлов по расписанию.

Итак, теперь вы можете прямо из Windows 10 подключаться к SSH серверам, копировать файлы с помощью scp без установки сторонних приложений и утилит.

The latest builds of Windows 10 and Windows 11 include a build-in SSH server and client that are based on OpenSSH.
This means now you can remotely connect to Windows 10/11 or Windows Server 2019 using any SSH client, like Linux distros.
Let’s see how to configure OpenSSH on Windows 10 and Windows 11, and connect to it using Putty or any other SSH client.

OpenSSH is an open-source, cross-platform version of Secure Shell (SSH) that is used by Linux users for a long time.
This project is currently ported to Windows and can be used as an SSH server on almost any version of Windows.
In the latest versions of Windows Server 2022/2019 and Windows 11, OpenSSH is built-in to the operating system image.

How to install SSH Server on Windows 10?

Make sure our build of Windows 10 is 1809 or newer. The easiest way to do this is by running the command:

Note. If you have an older Windows 10 build installed, you can update it through Windows Update or using an ISO image with a newer version of Windows 10 (you can create an image using the Media Creation Tool). If you don’t want to update your Windows 10 build, you can manually install the Win32-OpenSSH port for Windows with GitHub.

Enable feature

We can enable OpenSSH server in Windows 10 through the graphical Settings panel:

  1. Go to the Settings > Apps > Apps and features > Optional features (or run the command ms-settings:appsfeatures)

  2. Click Add a feature, select OpenSSH Server (OpenSSH-based secure shell (SSH) server, for secure key management and access from remote machines), and click Install

Install using PowerShell

We can also install sshd server using PowerShell:

Add-WindowsCapability -Online -Name OpenSSH.Server*

Install using DISM

Or we can also install sshd server using DISM:

dism /Online /Add-Capability /CapabilityName:OpenSSH.Server~~~~0.0.1.0

If you want to make sure the OpenSSH server is installed, run the following PS command:

Get-WindowsCapability -Online | ? Name -like 'OpenSSH.Server*'

How to uninstall SSH Server?

Use the following PowerShell command to uninstall the SSH server:

Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

How to Install SSH Server on Windows 11?

Also, you can add the OpenSSH Server on Windows 11.

  1. Go to Settings > Apps > Optional features;
  2. Click View Features;
    ssh to windows server

Select OpenSSH Server from the list and click Next > Install;

ssh into windows machine

Wait for the installation to complete.

connect to windows via ssh

The OpenSSH binaries are located in the C:\Windows\System32\OpenSSH\ folder.

ssh to windows machine

Configuring SSH Service on Windows 10 and 11

Check the status of ssh-agent and sshd services using the PowerShell command Get-Service:

how to ssh to windows

As we can see, both services are in a Stopped state and not added to the automatic startup list. To start services and configure autostart for them, run the following commands:

Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'

Start-Service 'ssh-agent'
Set-Service -Name 'ssh-agent' -StartupType 'Automatic'

We also need to allow incoming connections to TCP port 22 in the Windows Defender Firewall. We can open the port using netsh:

netsh advfirewall firewall add rule name=SSHD service dir=in action=allow protocol=TCP localport=22

Or we can add a firewall rule to allow SSH traffic using PowerShell:

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

Now we can connect to Windows 10 using any SSH client. To connect from Linux, use the command:

ssh -p 22 admin@192.168.1.90

Here, the admin is a local Windows user under which we want to connect. 192.168.1.90 is an IP address of your Windows 10 computer.

how to ssh to windows 10

After that, a new Windows command prompt window will open in SSH session.

Hint. To run the PowerShell.exe cli instead of cmd.exe shell when logging in via SSH on Windows 10, we need to run the following command in Windows 10 (under admin account):

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force

Now, we change the default OpenSSH shell. From here, when connecting to Windows via SSH, you will immediately see PowerShell prompt instead of cmd.exe.

If you want to use key-based ssh authentication instead of password authentication, you need to generate a key using ssh-keygen on your client.

Then, the contents of the id_rsa.pub file must be copied to the c:\users\admin\.ssh\authorized_keys file in Windows 10.

After that, you can connect from your Linux client to Windows 10 without a password. Use the command:

ssh -l admin@192.168.1.90

Configuration

We can configure various OpenSSH server settings in Windows using the %programdata%\ssh\sshd_config configuration file.

For example, we can disable password authentication and leave only key-based auth with:

PubkeyAuthentication yes
PasswordAuthentication no

Here we can also specify a new TCP port (instead of the default TCP 22 port) on which the SSHD will accept connections. For example:

Using the directives AllowGroups, AllowUsers, DenyGroups, DenyUsers, you can specify users and groups who are allowed or denied to connect to Windows via SSH:

  • DenyUsers theitbros\jbrown@192.168.1.15 — blocks connections to username jbrown from 192.168.1.15 hostsж
  • DenyUsers theitbros\* — prevent all users from theitbros domain to connect host using sshж
  • AllowGroups theitbros\ssh_allow — only allow users from theitbtos\ssh_allow connect hostю
  • The allow and deny rules of sshd are processed in the following order: DenyUsers, AllowUsers, DenyGroups, and AllowGroups.

After making changes to the sshd_config file, you need to restart the sshd service:

Get-Service sshd | Restart-Service –force

ssh to a windows machine

In previous versions of OpenSSH on Windows, all sshd service logs were written to the text file C:\ProgramData\ssh\logs\sshd.log by default.

On Windows 11, SSH logs can be viewed using the Event Viewer console (eventvwr.msc). All SSH events are available in a separate section Application and Services Logs > OpenSSH > Operational.

For example, the screenshot shows an example of an event with a successful connection to the computer via SSH. You can see the ssh client’s IP address (hostname) and the username used to connect.

sshd: Accepted password for jbrown from 192.168.14.14. port 49833 ssh2

ssh to a windows machine

Windows has offered a native SSH client and integrated SSH tools since the Windows 10 version. With these, you can connect to SSH servers without third-party software and even run your own Windows 10 SSH server.

Quick summary of how to activate Windows 10 SSH

Activate Client:

  1. Open “Settings” > “Apps” > “Apps & Features” > “Optional Features” and check if the OpenSSH client is installed — if necessary, install it via “Add Feature”.
  2. Open command prompt as administrator, e.g. with Windows search > “cmd.exe” > “run as administrator”.
  3. Enter CMD command ssh.
  4. Connect to the desired server with ssh name@server.
  5. If necessary, consider the port: default is port 22, change port with -pPortnumber behind the server name.
  6. If necessary, confirm host key fingerprint with Yes and enter password for the first connection.

Set up a Windows 10 SSH server:

  1. Open “Settings” > “Apps” > “Apps & Features” > “Optional Features.
  2. Select “Add Features” and “OpenSSH Server” and “Install” (admin rights required).
  3. Set the startup type for “OpenSSH Authentication Agent” and “OpenSSH Server” to “Automatic” in the Windows “Services” app.
  4. Check firewall rules in the Run dialog with Get-NetFirewallRule -Name *SSH*.
  5. Connect to the SSH server by entering ssh <server_name>.

What is Windows 10 SSH (Secure Shell)?

The Secure Shell (SSH) is used to establish a secure network connection between computers or servers. This works thanks to native Windows SSH tools via CMD commands and remote desktop without having to sit at the computer in question in the network. Just like Ubuntu SSH you don’t need any third-party software and is done securely over connections which are encrypted via SCP and SFTP.

This offers many advantages for administrators who use an SSH server-client connection to do tasks remotely. A connection between Linux and Windows computers, remote control of the computer, and transfer of encrypted data are also possible.

The advantage of the SSH protocol is secure remote access, thanks to the following security features:

  • Client-server authentication
  • Encrypted data transfer
  • Data integrity

If you want to use SSH in Windows 11, follow our guide to Windows 11 SSH.

How do you use the Windows 10 SSH client?

These are the requirements for using SSH remote access in Windows:

  • At least Windows 2019 or Windows 10 (version 1809)
  • At least PowerShell 5.1
  • Administrator rights

Follow these steps to use the Windows 10 OpenSSH client:

Step 1: Check via “Settings” > “Apps” > “Apps & Features” > “Optional Features” whether the OpenSSH client is already installed. If not, go to “Add Feature”, enter “OpenSSH Client” and click “Install”.

The Optional Features menu with the OpenSSH client

By default, the Windows 10 SSH client should already be present under Optional Features

Step 2: Once the client is installed, open the command prompt as an administrator by typing “cmd.exe” in the Windows search and then selecting “run as administrator”.

Step 3: To open the native SSH tool in Windows 10, enter the following CMD command:

You’ll see the SSH User Guide with the command syntax and all the current possible parameters offered by the SSH client.

The SSH Usage Guide in the “Run” dialog

Use the ssh command to call up all the important SSH parameters in the Run dialog.

Step 4: If you want to access Raspberry Pi, for example, follow similar steps to macOS and Linux. Connect to the remote server on the required Raspberry device with the following command:

In the address, “Pi” stands for the username on the remote server and “raspberrypi” for the remote server. If it should be an IP address in the network or also an external remote server, use this command syntax:

ssh name@mywebsite.mydomainname.com

CMD

Step 5: By default, the SSH client uses port 22. If the addressed server uses a different port, for example, port 7200, establish the connection by specifying the port as follows:

ssh pi@raspberrypi -p 7200

CMD

Step 6: If connecting to the server for the first time, confirm the host key fingerprint by entering “Yes”. If you have set up a remote server yourself, you do not need to worry about this because the remote server belongs to you. Enter the user password to control the remote computer via SSH and terminal commands.

How do you set up a Windows 10 SSH server?

If you want to set up an SSH server in addition to accessing your computer remotely, follow these steps. You’ll need to install an OpenSSH server. This is usually not pre-installed under Windows but can be quickly added.

Both Linux and Windows are suitable for setting up and operating a private web server. Our comparison “Linux vs. Windows Servers” reveals the advantages of each solution.

Here’s how to do it:

Step 1: Follow the “Settings” > “Apps” > “Apps & Features” > “Optional Features” path.

Step 2: Go to “Add Features” and click “OpenSSH Server” in the list and click “Install”. This step can be performed only with administrator privileges.

The installation of an OpenSSH server under the Windows features

An OpenSSH server can be retrofitted in the optional Windows features.

Step 3: For the SSH server, Windows installs the OpenSSH Authentication Agent (if not already installed) and OpenSSH Server services. If you want to use SSH regularly, change the startup type of the services to “Automatic”. To do this, enter “Services” in the Windows search and launch the Services app. Right-click on the corresponding services and go to “Properties”. Now change the startup type to “Automatic”.

Step 4: Check whether the SSH firewall rules have been activated. To do this, enter the following command in the “Run” dialog and check the firewall rules:

Get-NetFirewallRule -Name *SSH*

CMD

Step 5: To connect to the Windows 10 SSH server, enter the following command:

If you encounter issues with your connection, you can follow our tips for fixing SSH errors.

Was this article helpful?

В этой статье рассмотрим, как установить и настроить встроенный SSH сервер на базе OpenSSH в Windows 10/11 и Windows Server 2022/2019. Вы узнаете, как подключиться к системе по защищенному SSH протоколу, как это делается в Linux.

Приобрести оригинальные ключи активации Windows Server можно у нас в каталоге от 1190 ₽
Установка OpenSSH сервера в Windows

OpenSSH сервер включен в современные версии Windows 10 (начиная с 1803), Windows 11 и Windows Server 2022/2019 как Feature on Demand (FoD). Установить его можно несколькими способами.

1. Установка через PowerShell:

Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*' | Add-WindowsCapability -Online

2. Установка через DISM:

dism /Online /Add-Capability /CapabilityName:OpenSSH.Server~~~~0.0.1.0

3. Через панель «Параметры»:

— Перейдите в Настройки -> Приложения -> Дополнительные компоненты -> Добавить компонент.

— Найдите OpenSSH Server и нажмите Установить.

4. Установка с помощью MSI пакета:

Вы можете установить OpenSSH с помощью MSI установщика, доступного на GitHub:

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 сервер установлен, выполните:

Get-WindowsCapability -Online | ? Name -like 'OpenSSH.Ser*'

State : Installed

Настройка SSH сервера в Windows

После установки OpenSSH на Windows появляются две службы:

ssh-agent (для управления ключами если вы настроили SSH аутентификацию по ключам)

sshd (собственно сам SSH сервер)

1. Настройка автозапуска SSH службы:

Выполните команду PowerShell для включения автозапуска SSH сервера:

Set-Service -Name sshd -StartupType 'Automatic'

Start-Service sshd

2. Проверка порта SSH:

Убедитесь, что сервер слушает на порту TCP:22:

netstat -na | find ":22"

3. Настройка брандмауэра:

Убедитесь, что брандмауэр разрешает подключения по SSH:

Get-NetFirewallRule -Name *OpenSSH-Server* |select Name, DisplayName, Description, Enabled

Если правило отключено, включите его:

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

Если правило отключено (состоянии Enabled=False) или отсутствует, вы можете создать новое входящее правило командой New-NetFirewallRule:

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

Конфигурация файла sshd_config

Конфигурационный файл OpenSSH сервера находится по пути C:\ProgramData\ssh\sshd_config. Вы можете отредактировать его через любой текстовый редактор. Например, откройте файл с помощью блокнота:

start-process notepad C:\ProgramData\ssh\sshd_config

1. Запрет подключения для пользователей/групп:

— Запретить подключение для определенного пользователя:

DenyUsers softcomputers\[email protected]
DenyUsers corp\*

— Разрешить доступ только для локальной группы:

AllowGroups sshadmins

2. Изменение порта SSH:

Для смены порта измените значение директивы Port.

После изменений не забудьте перезапустить службу:

Restart-Service sshd

3. Чтобы разрешить подключение только для определенной доменной группы:

AllowGroups softcomputers\sshadmins

По умолчанию могут к openssh могут подключаться все пользователи Windows. Директивы обрабатываются в следующем порядке: DenyUsers, AllowUsers, DenyGroups,AllowGroups.

4. Можно запретить вход под учетными записями с правами администратора, в этом случае для выполнения привилегированных действий в SSH сессии нужно делать runas.

DenyGroups Administrators

Следующие директивы разрешают SSH доступ по ключам и по паролю

PubkeyAuthentication yes
PasswordAuthentication yes

5. Вы можете изменить стандартный SSH порт TCP/22, на котором принимает подключения OpenSSH в конфигурационном файле sshd_config в директиве Port.

6. После любых изменений в конфигурационном файле sshd_config нужно перезапускать службу sshd:

restart-service sshd

Подключение по SSH к Windows компьютеру

Для подключения к Windows через SSH можно использовать любые SSH клиенты (например, PuTTY или встроенный клиент 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)

softcomputers\alex@server1 – NetBIOS формат имени

Если используется аутентификация по Kerberos в домене, включите ее в конфигурационном файле:

GSSAPIAuthentication yes

После этого можно прозрачно подключать к SSH серверу с Windows компьютера в домене из сессии доменного подключения. В этом случае пароль пользователя не указывается и выполняется SSO аутентификация через Kerberos:

ssh -K server1

При первом подключении появится стандартный запрос на добавление узла в список известных SSH хостов.

Нажимаем — «Да»

В открывшееся окне авторизуемся под пользователем Windows.

При успешном подключении запускается командная оболочка cmd.exe со строкой-приглашением.

admin@win10tst C:\Users\admin>

В командной строке вы можете выполнять различные команды, запускать скрипты и приложения.

Чтобы запустить интерпретатор 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

Логи SSH подключений пишутся в журнал событий Windows через Event Tracing for Windows (ETW). Чтобы просмотреть логи:

1. Откройте Event Viewer (eventvwr.msc).

2. Перейдите в Application and Services Logs -> OpenSSH -> Operational.

Пример события успешного подключения по паролю:

EventID: 4

sshd: Accepted password for user1 from 192.168.31.102 port 55432 ssh2

Если необходимо, вы можете настроить запись логов в текстовый файл. Для этого добавьте в файл sshd_config директивы:

SyslogFacility LOCAL0

LogLevel INFO

Перезапустите службу sshd для применения изменений и проверьте, что теперь логи SSH сервера пишутся в файл C:\ProgramData\ssh\logs\sshd.log

Теперь вы знаете, как настроить и использовать OpenSSH сервер на Windows для удаленного подключения по защищенному протоколу SSH.

Using SSH on Windows 10 used to be a pain that required third-party software such as PuTTy. In 2018, though, Microsoft enabled native SSH commands via an OpenSSH Windows integration.

If you’re unfamiliar with SSH, it stands for Secure Shell, a protocol typically used for connecting to Linux servers. The command-line SSH tool lets you log into your server and run commands remotely to perform any required task.

The Integrated OpenSSH for Windows Client

The OpenSSH client for Windows is installed by default on Windows Server 2019 and Windows 10 build 1809 and later. However, if SSH commands aren’t working for you, it’s because you need to enable them in your Windows features. We’re going to walk you through enabling SSH on Windows 10 via this method, then show you how to use it. Let’s get started:

How to Install the SSH Client on Windows 10

Though Windows 10 OpenSSH is installed by default on most versions, it may not be for everyone. Thankfully, enabling SSH only takes a few seconds. Here’s how:

  1. Press the Search button and type “Optional feature”
     

    Click the top result, which should read, “Add an optional feature”.

    Windows 10 - Search - installa an optional feature

  2. Click “Add a feature” in Settings
     

    Windows 10 - installa an optional feature

  3. Install the Windows OpenSSH Client
     

    Type “SSH” in the optional features search bar, then tick the entry that reads “OpenSSH Client”. Finally, click the “Install” button at the bottom of your Window. The process will take a few seconds to complete and shouldn’t require a restart.

    Windows 10 - installa an optional feature - openSSH

How to Use SSH Commands in Windows 10

Once you have the Windows 10 SSH client installed, using it is a simple matter. You can use Command Prompt for this, or PowerShell SSH, whichever you prefer. The SSH commands are the same across both applications, so you can still follow along.

  1. Open Command Prompt (or PowerShell)
     

    Press Start and then type “Command Prompt”. Click the top result.

    Windows 10 - Open Command Prompt

  2. Run the SSH command to view its usage guide
     

    Command Prompt will return a full list of options and syntax for you to use as you require.

    Windows 10 - Command Prompt - Enter ssh Command

  3. Connect to your server via your Windows Open SSH client
     

    In most cases, you won’t need the above options to connect to your SSH server. Instead, you can simply run:

    ssh username@host

    You’ll be prompted for your server’s root password, which you can type and press Enter to log in.

    If your server uses a different port to the standard for SSH, you can specify it by adding -p portnumber to the end of your command.

    The first time you connect to a server, you’ll receive a warning asking if you’re sure you want to connect. Type yes and press Enter to connect.

    Windows 10 - Command Prompt - Enter the Cmd to Connect to a Server - Accept it

How to Open a Port in Firewall or Enable the Telnet Client

Now you know how to install SSH on Windows. However, if you’re still having issues, you may need to follow our tutorial on how to open or close a port in Windows 10 Firewall to add an exception for your SSH port.

Finally, if your server uses the older Telnet protocol, you may want to follow our tutorial on how to enable the Telnet client in Windows 10 instead.

Last Updated on February 14, 2022 7:43 pm CET

Ryan Maskellhttps://ryanmaskell.co.uk

Ryan has had a passion for gaming and technology since early childhood. Fusing the skills from his Creative Writing and Publishing degree with profound technical knowledge, he enjoys covering news about Microsoft. As an avid writer, he is also working on his debut novel.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • После обновления windows 10 не видит hdmi
  • Как выйти из синего экрана смерти windows 7
  • Сколько сейчас стоит переустановить windows
  • Извлечь серийный номер windows
  • Двд привод не читает диски windows 10