@DevOpsSummit Authors: Pat Romanski, Yeshim Deniz, Elizabeth White, Liz McMillan, Ram Sonagara

Related Topics: @DevOpsSummit, Containers Expo Blog, Cloud Security

@DevOpsSummit: Blog Feed Post

How to Configure SSHD in Windows By @XebiaLabs | @DevOpsSummit [#DevOps]

Recently I was with a customer who wanted to use SSH/BASH because it made more sense due to the nature of their security profile

How to Configure SSHD in Windows as an Overthere Host for XL Deploy
by Rick Broker

Some times our customers would prefer to use SSH to connect from the server our XL Deploy is running on and their targets. By default Windows does not support SSH, but XebiaLabs’ tools do support SSH on windows. The tricky part is that most implementations of SSH for Windows also require you to use BASH as a default shell.  In this blog post I will discuss how you can set up SSH/BASH on Windows to be used with XL Deploy.  While I’m specifically talking about XL Deploy these principals should work the same for the rest of XebiaLabs’ XL tools.

Recently, I was with a customer who wanted to use SSH/BASH because it made more sense due to the nature of their security profile.  We installed Cygwin64 and with a few configuration changes they were able to use XL Deploy over SSH to their Windows systems.

The process starts out by downloading and installing Cygwin64 from cygwin.com.  There are several SSHD services that you can get for Windows, but the problem is that most of the free ones are 32 bit versions.  In Windows a 32 bit process can not start a 64 bit process, so it is better to use a 64 bit SSHD if you have a 64 bit version of Windows.

To install Cygwin64 sshd as a Windows Service we will start buy downloading Cygwin64 from the web https://cygwin.com/install.html.  The download will go into your download folder.

Screen Shot 2015-03-02 at 3.06.39 PM

One the file is downloaded you can double click on the file to start the install process.

Screen Shot 2015-03-02 at 3.07.28 PM

Click Next

Screen Shot 2015-03-02 at 3.07.45 PM

Select your internet connection type and click next.

Screen Shot 2015-03-02 at 3.08.02 PM

Change the install path if you like.  I prefer to just use the default.

Screen Shot 2015-03-02 at 3.08.19 PM

Changed the local package directory if you like.  I prefer to just use the default.  Click on next.

Screen Shot 2015-03-02 at 3.08.35 PM

I have a direct connection.  Click next.

Screen Shot 2015-03-02 at 3.08.56 PM

My preferred mirror site is osuosl.org.  Select your preferred mirror site an click next.

Screen Shot 2015-03-02 at 3.14.19 PM

In addition to the base Cygwin64 install we will need to install OpenSSH.  So in the search box type “openssh” and select OpenSSH for installation and click on Next.

Screen Shot 2015-03-02 at 3.14.34 PM

After the install you will be asked if you want to see the readme file on make a desktop short cut.  I prefer to use the Cygwin bash shell over the Windows CMD window so I usually ask to have the short cut, but not the readme.

Screen Shot 2015-03-02 at 3.15.53 PM

Start a Cygwin bash session….

Screen Shot 2015-03-03 at 12.30.03 PM

Verify file/user permissions in the cygwin bash window by executing the commands as follows:

[email protected]@u0sshd
[email protected]@u0sshd
[email protected]@u0sshd
[email protected]@u0sshd
[email protected]@u0sshd
[email protected]@u0sshd

Navigate to the C:\cygwin64 directory, open the bat file in edit mode using any editor, and add the following line before invoking the bash shell

set CYGWIN=binmode ntsec

Screen Shot 2015-03-02 at 3.17.35 PM

To verify if Cygwin (cygrunsrv) is installed properly, run C:\cygwin\Cygwin.bat, and execute the following command:

Screen Shot 2015-03-02 at 3.20.57 PM

If Cygwin is installed properly, then all the Cygwin help options are displayed on the screen. However, if this command returns an error message, then you may have to reinstall Cygwin.

To configure the SSHD service, run C:\cygwin\Cygwin.bat, and execute the following command:


After running the command, you are prompted the following questions:

*** Info: already exists). This account is then used to run these special
*** Info: servers.

*** Info: Note that creating a new user requires that the current account
*** Info: have Administrator privileges itself.

*** Info: No privileged account could be found.

*** Info: This script plans to use 'cyg_server'.

*** Query: Create new privileged user account 'WIN201201\xldeploy' (Cygwin name: 'xldeploy')?
(yes/no) yes
*** Info: Please enter a password for new user xldeploy.  Please be sure
*** Info: that this password matches the password rules given on your system.
*** Info: Entering no password will exit the configuration.
*** Query: Please enter the password:
*** Query: Reenter:

*** Info: User 'xldeploy' has been created with password 'XXXXXX'.
*** Info: If you change the password, please remember also to change the
*** Info: password for the installed services which use (or will soon use)
*** Info: the 'xldeploy' account.

*** Info: The sshd service has been installed under the 'xldeploy'
*** Info: account.  To start the service now, call `net start sshd' or
*** Info: `cygrunsrv -S sshd'.  Otherwise, it will start automatically
*** Info: after the next reboot.

*** Info: Host configuration finished. Have fun!

You should be able to verify that the SSHD server has been installed as a Windows service by running cygrunsrv -Q sshd as follows:

Screen Shot 2015-03-02 at 3.25.06 PM

If the service has been installed correctly you can start the SSHD service as follows:

Screen Shot 2015-03-02 at 3.25.55 PM

When we use SSH/BASH with XL Deploy we will need BAT files to be executable from the BASH command line.  To do this we need to add a line to the .bashrc of the user XL Deploy will log into the Windows box from.  Edit or create a .bashrc in the users home directory and add the line as follows:

find /cygdrive/c/Windows/Temp -name "*.bat" -exec chmod +x {} +

You need to make sure that you .bashrc does not output anything while executing as that will keep it form executing properly.  Now in XL Deploy we can configure the Windows server as an SSH Overthere host as follow:

Screen Shot 2015-03-03 at 1.39.30 PM

We should be able to test our configuration with the “Connection Test” control task.  The results of that test should look similar to the following:

Screen Shot 2015-03-08 at 2.17.24 PM

At this point you should be able to use our new WinSshHost in your infrastructure and install applications with SSH from the XL Deploy server.

The post How To Configure SSHD In Windows As An Overthere Host For XL Deploy appeared first on XebiaLabs.

Read the original blog entry...

More Stories By XebiaLabs Blog

XebiaLabs is the technology leader for automation software for DevOps and Continuous Delivery. It focuses on helping companies accelerate the delivery of new software in the most efficient manner. Its products are simple to use, quick to implement, and provide robust enterprise technology.

@DevOpsSummit Stories
The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.
DevOpsSummit New York 2018, colocated with CloudEXPO | DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City. Digital Transformation (DX) is a major focus with the introduction of DXWorldEXPO within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throughout enterprises of all sizes.
With 10 simultaneous tracks, keynotes, general sessions and targeted breakout classes, @CloudEXPO and DXWorldEXPO are two of the most important technology events of the year. Since its launch over eight years ago, @CloudEXPO and DXWorldEXPO have presented a rock star faculty as well as showcased hundreds of sponsors and exhibitors! In this blog post, we provide 7 tips on how, as part of our world-class faculty, you can deliver one of the most popular sessions at our events. But before reading these essential tips, please take a moment and watch this brief video from Sandy Carter.
DXWordEXPO New York 2018, colocated with CloudEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.