Ssh server windows server 2008

Введение

Существует несколько опций командной строки, доступных для настройки Window Server 2008 через сеть. Например, Windows Powershell, ServerManager.exe, или сервер telnet. Однако, проверенным и надежным способом, который так хорошо работал практически на всех типах устройств инфраструктуры, использующихся сегодня (включая Windows Server 2008, Cisco Routers, Linux серверы и т.д.) является SSH. В этой статье мы узнаем, как устанавливать SSH Server в Windows Server 2008.

Что такое SSH?

SSH – это безопасная оболочка (secure shell), стандарт, определенный в RFC 4251. Это сетевой протокол, который открывает безопасный канал между двумя устройствами, используя TCP порт 22. Этот канал также можно использовать для SFTP и SCP (безопасного FTP и защищенного копирования соответственно). Чтобы он работал, вам нужен безопасный сервер в системе, к которому вы подключаетесь, и безопасный клиент на клиенте, с которого вы подключаетесь.

Следует помнить, что SSH функционально совместим с различными платформами. К примеру, вы можете подключить SSH сервер на маршрутизаторе Cisco с клиента Windows, вы можете подключиться к серверу Linux с маршрутизатора Cisco, а также можете подключиться к Windows 2008 Server с клиента Linux.

Единственной возможной проблемой совместимости может стать тот факт, что существует две версии SSH, SSH версии 1 и SSH версии 2. Вы должны убедиться, что клиент и сервер поддерживают одну и ту же версию, чтобы знать, какую версию использовать при подключении. Обычно версии могут быть оговорены.

Хотя ни одна из ОС Windows не идет с SSH сервером или клиентом, их очень просто устанавливать.

Имея SSH сервер на своем Windows 2008 Server, вы можете:

  • Удаленно иметь доступ к командной строке вашего Windows 2008 Server
  • Управлять сервером через сеть, даже если вы не имеете доступа к интерфейсу GUI
  • Удаленно управлять вашим Windows 2008 Server с любого устройства, имеющего SSH клиента
  • Делать все это через зашифрованное соединение, которое может безопасно проходить даже через интернет

Какие опции сервера SSH доступны для Windows 2008 Server?

Существует ряд опций сервера SSH, доступных для Windows Server 2008. Вот лишь некоторые из тех, с которыми мне довелось иметь дело:

  • SSH.com ‘ Бесплатный некоммерческий SSH сервер
  • SSH.com ‘ SSH Tectia клиент и сервер (коммерческий)
  • OpenSSH ‘ смотреть статью о том, как устанавливать openssh сервер в Vista (применимо к Windows Server 2008)
  • Van Dyke ‘ vShell 3.0 Server (коммерческий)
  • Free SSHd
  • WinSSHd (коммерческий)
  • Kpym Telnet/SSH Server
  • copSSH для Windows (измененная версия OpenSSH)
  • Sysax Multi-Server (SSH Server) для Windows

Как только вы запустили SSH сервер, вам понадобится SSH клиент для Windows. Вот несколько самых популярных SSH клиентов для Windows, которых мне удалось найти:

  • PuTTY
  • Van Dyke — SecureCRT (коммерческий)

Как установить FreeSSHd — SSH сервер в Windows Server 2008?

Поскольку установка Free SSHd так проста по сравнению с другими опциями (особенно с OpenSSH в Windows), я выбрал эту версию, чтобы показать процесс установки Free SSHd. Помните, что FreeSSHd абсолютно бесплатен (как видно из его названия) для личного / некоммерческого использования, а также для коммерческого использования.

Чтобы начать процесс, я скачал FreeSSHd.exe на свою систему Windows Server 2008 и запустил загруженную программу. Графическая установка началась.

Я принял все параметры по умолчанию для установки и нажал «Установить», чтобы начать процесс.

По завершении я решил не запускать SSHd в качестве службы, однако вы можете выбрать этот вариант при желании.

1

Я заметил, что SSHd сервер уже работал.

Приложение FreeSSHd может предложить следующее:

  • Возможности SSH сервера и Telnet сервера
  • Опции запуска SSHd только в определенных интерфейсах
  • Различные способы аутентификации, включая интегрированную NTLM аутентификацию на Windows AD
  • Различные способы шифрования, включая AES 128, AES 256, 3DES, Blowfish и т.д.
  • Опция создания защищенного туннеля в соединении
  • Опциональный Secure FTP (sFTP) – для безопасного FTP, смотреть FreeFTPd website
  • Возможность управлять пользователями и ограничивать доступ к безопасной оболочке, безопасному туннелю и безопасному FTP
  • Возможность предоставлять доступ только определенным узлам или подсетям
  • Возможность регистрировать в журнал все подключения и команды, выполненные через FreeSSHd
  • Просмотр пользователей, подключенных в данный момент
  • Автоматическое обновление FreeSSHd

Чтобы войти, мне понадобилось выполнить две вещи:

  1. Добавить новую пользовательскую учетную запись и разрешить доступ к командной строке SSH
  2. Открыть исключения в моем брандмауэре Windows Server 2008

Чтобы добавить нового пользователя, я перешел по вкладке «Пользователи» и нажал Добавить.

Я решил установить логин для моей учетной записи локального администратора Windows. Я установил авторизацию на NTLM. Так в базе данных FreeSSHd нет локального пароля, и если пароль администратора измениться в базе данных локальной учетной записи Windows, вам не придется менять пароль в базе данных учтенной записи FreeSSHd.

Я авторизировал этого нового пользователя на вход только в SSH.

2

Вот результаты:

3

Второе, что мне нужно было сделать для того, чтобы позволить себе вход, это открыть исключения брандмауэра Windows. Хотя я мог вообще отключить брандмауэр Windows вместо того, чтобы открывать порты, конечно, самой безопасной опцией было оставить брандмауэр включенным и разрешить исключение для SSH ‘ TCP порт 22.

Для этого я перешел в меню Пуск -> Администрирование -> Брандмауэр Windows с расширенной безопасностью.

4

Далее, я нажал на входящих правилах, а затем Новое правило.

5

Далее я выбрал добавление правила порта.

6

Я указал только TCP порт 22.

7

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

Протестируйте подключение

Чтобы протестировать подключение, я использовал SecureCRT со своей машины Windows XP на Windows Server 2008 сервер через SSH.

Для этого я подключился к серверу через IP адрес (или имя домена). Я выбрал опцию «Принять» сертификат сервера и сохранил его.

8

Я вошел на сервер, используя логин и пароль администратора.

И, успех! Я смог получить доступ к серверу через SSH!

9


03.06.2009 —


Опубликовал: |
ms windows server 2008

Sorry, the comment form is closed at this time.

windows:server:2008:r2:openssh:install

    • На момент написания это v8.1.0.0p1-Beta.

  1. Распаковать в C:\Program Files\;

    • Или куда угодно, но помните, что из него в дальнейшем будут запускаться службы.

  2. Добавить путь C:\Program Files\OpenSSH-Win64 в переменную PATH.

    • Свойства системы – Дополнительные параметры – Переменные среды… – Системные переменные – Path, далее в конце стоки через точку с запятой вставить путь без кавычек.

  3. Запустить PowerShell с правами администратора, перейти в каталог C:\Program Files\OpenSSH-Win64 и ввести ./install-sshd.ps1 (PowerShell пока не закрывать!);

  4. Запустить службу OpenSSH SSH Server (sshd) и настроить ее на автоматический запуск;

  5. Вернуться в PowerShell и выполнить ./FixHostFilePermissions.ps1 везде соглашаясь;

Если есть ошибки, проверить наличие папки C:\ProgramData\SSH и ключевых файлов в ней. Ключевые файлы создаются при первом запуске службы.


Дисклеймер

  • Использование материалов данной базы знаний разрешено на условиях лицензии, указанной внизу каждой страницы! При использовании материалов активная гиперссылка на соответствующую страницу данной базы знаний обязательна!

  • Автор не несет и не может нести какую либо ответственность за последствия использования материалов, размещенных в данной базе знаний. Все материалы предоставляются по принципу «как есть». Используйте их исключительно на свой страх и риск.

  • Все высказывания, мысли или идеи автора, размещенные в материалах данной базе знаний, являются исключительно его личным субъективным мнением и могут не совпадать с мнением читателей!

  • При размещении ссылок в данной базе знаний на интернет-страницы третьих лиц автор не несет ответственности за их техническую функциональность (особенно отсутствие вирусов) и содержание! При обнаружении таких ссылок, можно и желательно сообщить о них в комментариях к соответствующей статье.

Последнее изменение: 2022/02/12 11:40 (внешнее изменение)

I’ve been playing around (in my copious free time 😉 ) with other methods of connecting to and managing Server 2008 Core. One of the things I’ve wanted to do was to be able to SSH directly to Server 2008 Core and have the same command line capability as I do on the console. To that end I did a quick search for similar work and found the following article at TechRepublic about installing an SSH server in Windows 2008. The difference that I wanted to do was to install it in Server Core rather than the full-blown version of 2008.

Like David Davis over at TechRepublic I decided to start with FreeSSHd as my SSH server. The first thing I needed to do was to get it onto the Server Core VM. Rather than downloading it to my desktop and then transferring it to the Server Core VM I decided that would rather download it directly to the Server Core machine. In order to do that I needed wget that would run on Windows. I used the wget binary I downloaded (to my desktop) from Bart Puype in Belgium. Once I copied wget to C:\Windows\System32 I used it download the FreeSSHd.exe binary from FreeSSHd.com.

To install freesshd, just run the freesshd.exe program and it will start up the install wizard. A couple of items to note — on Server Core do not bother with creating a Start Menu item for FreeSSHd and don’t bother with creating a desktop icon either. One of the problems that I encountered when I installed FreeSSHd on Server Core was that I could not configure the SSH server since the task bar icon did not appear on the right (as should be the case since there is no task bar in Server 2008 Core). To configure FreeSSHd I had to edit the freesshdservice.ini file in the C:\Program Files\freesshd directory (the default location for the installation).

A small point to note. Server 2008 Core’s firewall is on by default (even if it’s a domain joined machine) and the policy is to block all inbound connection attempts but to allow outbound connections. After installing FreeSSHd I needed to modify the firewall and decided to use netsh to do so. The command I used was

netsh advfirewall firewall add rule name="SSHd" dir=in action=allow protocol=TCP localport=22

Very simple…I love netsh 🙂

Another problem I ran into was getting the NT authentication to work. I did manage to get the password authentication working but I wanted to tie the FreeSSHd server into the Windows authentication. I’m still not 100% sure as to where the problem lies with the NT authentication integration and will investigate it further.

One of the biggest drawbacks to FreeSSHd is that there is very little (re: almost none) documentation that covers the freesshdservice.ini file. You need to read the forums over at freesshd.com in order to get a sense of what the settings are for the file and what specific changes to the file cause in the overall operation of the server. I hope to get that put together and posted here this summer as I think others will find it useful.

To get the password authentication working I installed FreeSSHd on a Windows Server 2003 system and then created the users I wanted there and copied over the relevant portions of the freesshdservice.ini file to the one on the Server 2008 Core VM. Then, to restart the service I would just issue the commands: net stop freesshdservice and net start freesshdservice and I was good to go. As you can see from the last capture in the gallery below I was able to connect to the server and log in using the account I had created on the Server 2003 system and copied over to the freesshdservice.ini file on the Server 2008 Core VM.

In the future I’m going to try some of the other freely available SSH servers and see if they provide an easier integration into Server 2008 Core.

There are a number of command line options available to configure Window Server 2008 over the network. For example, Windows Powershell, ServerManager.exe, or a telnet server. However, the tried and true method that has worked so well with just about every type of infrastructure device in use today (including Windows Server 2008, Cisco Routers, Linux servers, and more) is SSH. In this article, learn how to install a SSH Server in Windows Server 2008.

SSH is the secure shell, a standard defined in RFC 4251. It is a network protocol that opens up a secure channel between two devices using TCP port 22. This channel can also be used for SFTP and SCP (secure FTP and secure copy, respectively). To make this work, you need a secure server on the system you are connecting to and a secure client on the client you are connecting from.

Keep in mind that SSH is completely interoperable between different platforms. For example, you could connect to a SSH server on a Cisco router from a Windows client, you could connect to a Linux server from a Cisco router, and you could connect to a Windows 2008 Server from a Linux client.

The only possible compatibility issue is that there are two versions of SSH, SSH version 1 and SSH version 2. You should make sure that the server and client support the same versions so that you know which version you are using when you connect. Usually, this version can be negotiated.

While none of the Windows operating systems come with a SSH Server or Client, they are very easy to install.

By having a SSH Server on your Windows 2008 Server, you can:

Remotely access the command line of your Windows 2008 Server
Control the Server over the network, even if you cannot access the GUI interface
Remotely manage your Windows 2008 Server from any device that has a SSH Client
Do all this over an encrypted connection that could even securely traverse the Internet

SSH Server options available for Windows 2008 Server

There are a number of SSH Server options available for Windows Server 2008. Here are just some of the few that I ran across:

SSH.com – Free non-commercial SSH Server
SSH.com – SSH Tectia Client and Server (commercial)
OpenSSH – see article on how to install openssh server in Vista (applies to Windows Server 2008)
Van Dyke – vShell 3.0 Server (commercial)
Free SSHd
WinSSHd (commercial)
Kpym Telnet/SSH Server
copSSH for Windows (a modified build of OpenSSH)
Sysax Multi-Server (SSH Server) for Windows
Once you have your SSH Server running, you will most likely need a SSH Client for Windows. Here are a couple of the most popular SSH Clients for Windows that I have found:

PuTTY
Van Dyke – SecureCRT (commercial)

Install of FreeSSHd – SSH Server in Windows Server 2008

Because the installation for Free SSHd is so simple as compared to others (especially as compared to OpenSSH in Windows), I have chosen to demonstrate how to install and use Free SSHd. Remember that FreeSSHd is totally free (as the name says) both for personal / non-commercial use but also for commercial use.

To start this process, I downloaded FreeSSHd.exe on my Windows Server 2008 system and ran the downloaded program. The graphical installation began.

I took all the defaults for the installation options and clicked Install to being the install.

When done, I opted not to run SSHd as a service but that may be what you want to do on your production server.

Figure 1: Do you want to run FreeSSHd as a service?

By running FreeSSHd as service, it would be available no matter if you were logged into the console or not. I also chose to create private keys for the SSH server.

Next, I ran the FreeSSHd shortcut on the desktop in order to configure and start the SSH server.

Figure 2: Running the FreeSSH Application

I could see that the SSHd server was already running.

The FreeSSHd application can offer the following:

Both SSH Server and Telnet Server capabilities
Options to run SSHd on only certain interfaces
Multiple methods of authentication, including integrated NTLM authentication to Windows AD
Multiple methods of encryption including AES 128, AES 256, 3DES, Blowfish, and more
Options to bring up a secure tunnel upon connection
Optional Secure FTP (sFTP) – for secure FTP, see the FreeFTPd website
The ability to administer users and restrict access to secure shell, secure tunnel, or secure FTP
Ability to allow access to only certain hosts or subnets
Ability to log all connections and commands performed through FreeSSHd
View currently connected users
Update FreeSSHd automatically
For me to be able to login, I had to do two things:

Add a new user account and allow SSH command line access
Open an exception in my Windows Server 2008 Firewall
To add a new user, I went to the Users tab and clicked Add.

I opted to set up a login for my local Windows administrator account. I set the authorization to NTLM. That way, there was no local password in the FreeSSHd database and if the administrator password changes in the local Windows account database, you don’t have to change the password in the FreeSSHd account database.

I authorized this new administrator SSH user to log in with SSH only.

Figure 3: Adding a SSHd user account with NTLM authorization

Here are the results:

Figure 4: A new SSHd user account added

The second thing I had to do to allow me to login was to open an exception in the Windows Firewall. While I could disable the Windows Firewall completely instead of opening the ports, of course the most secure option is to leave the firewall up and allow for an exception for SSH – TCP port 22.

To do that, I went to Start -> Administrative Tools -> Windows Firewall with Advanced Security.

Figure 5: Opening Windows Firewall with Advanced Security

Next, I clicked on Inbound Rules, then on New Rule.

Figure 6: Adding a new Inbound Rule

Next, I chose to add a Port rule.

Figure 7: Choosing to add a Rule for a Port

I specified TCP port 22 only.

Figure 8: Specifying TCP port 22 only

Take the defaults to Allow the Connection, apply this to All domains, and give the rule a Name of your choice.

Test the Connection

To test the connection, I used SecureCRT from my Windows XP machine to the Windows Server 2008 server, via SSH.

To do this, I connected to the server via the IP address (or domain name). I chose to Accept the server’s certificate and save it.

Figure 9: Connecting via SSH and logging in with your Windows username & password

I logged into the server using the administrator login and password.

And, success! I was able to access the server via SSH!

Figure 10: A successful connection to the Windows 2008 Server via SSH

In Summary
SSH is an excellent tool for Windows Server 2008 administrators to consider for remote server management. In this article, you learned how SSH can help you, the options available for SSH Server and SSH Client installations, and how to install one of those options, FreeSSHd.

1. Download Microsoft’s open source openssh
Download the latest binary version: https://github.com/PowerShell/Win32-OpenSSH/releases

2. Unzip to C:\Program Files and rename it to OpenSSH

3. Start Window PowerShell and enter the C:\Program Files\OpenSSH directory
4. Enter commands to install sshd and ssh-agent services

powershell -ExecutionPolicy Bypass -File install-sshd.ps1

5. Open the firewall and open port 22

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

6. Set boot up

Set-Service sshd -StartupType Automatic
Set-Service ssh-agent -StartupType Automatic

7, start the service

Start-Service sshd
Start-Service ssh-agent

8. Connection test
Use xshell to enter ip, username and password are the username and password of Win 2008 r2 login

Reference link:
Win 2008 r2 install SSH server:
https://www.jianshu.com/p/b5b760bc56ff

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

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Стандартный файрвол windows 10
  • Как смотреть mov на windows 10
  • Windows пробел поменять на alt shift
  • Smssinit замедляет загрузку windows 10
  • Apc index mismatch windows 10 что за ошибка