⬆️ ⬇️

Manage Windows Server over SSH in the Azure Pack Infrastructure Cloud

In this article, we will look at how to quickly and simply configure SSH connectivity to a Windows Server and manage heterogeneous infrastructures on Windows and Linux through a terminal, connecting in a single way.



This method will especially help macOS and Linux users in managing heterogeneous infrastructures through the terminal, as there is still no full-fledged RSRP provider for Powershell Core (but Microsoft is working on it ), so simply connecting to the Windows Server from cross-platform Powershell Core is not will succeed. We will be helped by OpenSSH for Windows , which is actively developing, and Microsoft supports this development financially .



In the Azure Pack Infrastructure cloud from InfoboxCloud, we have already pre-created an image with Windows Server, version 1709 for modern web applications and services requiring the Microsoft stack .

')

The image is preinstalled and configured:





The article also describes how to add support for SSH on Windows on your own server or virtual machine.



At the end of the article a discount on the cloud .



Why do I need to connect to the Windows Server via SSH



Modern heterogeneous IT infrastructures are more convenient to maintain using a single connection method, both to Windows and to Linux, with the ability to connect servers to each other, run automation scripts, collect data, and so on. Also, a modern administrator's computer can work not only on Windows, but also on Linux or macOS and the ability to use the usual method of connection through the console will help users use Windows Server effectively. In our cloud, the cost of Windows and Linux virtual machines is the same, and you can choose the best OS for your task without compromising.



How to connect to Windows Server over SSH?



Ready image for modern web applications and services


Fill out the form to access the cloud.

We will pre-create all the required infrastructure for you and you can immediately start working.



To connect via SSH as a login, use Administrator, the password specified when creating servers (will be sent in a letter with access).







The connection is successful; you can work with both the CMD and Powershell from your familiar environment with the most modern Windows Server version 1709.





If you want to create servers yourself - use the image "WS1709 DC Core EN SSH Docker".





To update the OS, use the command



sconfig 


To update the preinstalled software, the command:



 choco upgrade all 


Need a GUI to manage your OS without it? Read the last article about Project Honolulu - a web-based management interface for modern Windows Server.



Self-installing OpenSSH on a Windows Server


If you are already using Windows Server ( come and we will migrate to the cloud and put everything to you :)), below we will tell you how to install OpenSSH yourself in the simplest way.



We will do this on the example of the usual Windows Server 2016. Connect to the server via RDP (port 3389).

Run Powershell as administrator.







Install the Chocolatey package manager with the command:



 Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) 








Now run the command:



 choco install openssh -params '"/SSHServerFeature"' 






To update the environment variables of an already running terminal, run the following command:



 refreshenv 


Check the connection to the Windows Server over SSH.







To enable the ability to execute remote commands, run Powershell and enter:



 Enable-PSRemoting 








Now you can fully manage Windows Server over SSH and from the Windows Server console connect to other Linux – servers even without installing Linux on Windows Subsystem for Linux (WSL).







25% off on cloud for article readers



In the following articles we will look at other technologies from the image for modern web applications and services on Windows, but we can not wait for a new article. To all new users who submitted an application before December 15, 2017, we give a 25% discount on Azure Pack Infrastructure cloud resources by March 1, 2018.



To get the discount, fill out the form https://infoboxcloud.ru/request and in the comment field enter the secret code: “Discount 25% from habr for innovation”. It will also be useful if you specify the required number of servers, for each number of processor cores, RAM, disk, and the desired OS. If you need to transfer the current IT infrastructure to the cloud - we will help with this.



If you have comments or suggestions in a new way, how to make it even more convenient - write to us .



Have a great day and successful work!

Source: https://habr.com/ru/post/342870/



All Articles