Welcome!

@DevOpsSummit Authors: Pat Romanski, Elizabeth White, Liz McMillan, Yeshim Deniz, Zakia Bouachraoui

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:

chmod0+r0/etc/passwd
chmod0u+w0/etc/passwd
chmod0+r0/etc/group
chmod0u+w0/etc/group
chmod07550/var
touch0/var/log/sshd.log
chmod06640/var/log/sshd.log
[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:

ssh-host-config

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
With more than 30 Kubernetes solutions in the marketplace, it's tempting to think Kubernetes and the vendor ecosystem has solved the problem of operationalizing containers at scale or of automatically managing the elasticity of the underlying infrastructure that these solutions need to be truly scalable. Far from it. There are at least six major pain points that companies experience when they try to deploy and run Kubernetes in their complex environments. In this presentation, the speaker will detail these pain points and explain how cloud can address them.
In an era of historic innovation fueled by unprecedented access to data and technology, the low cost and risk of entering new markets has leveled the playing field for business. Today, any ambitious innovator can easily introduce a new application or product that can reinvent business models and transform the client experience. In their Day 2 Keynote at 19th Cloud Expo, Mercer Rowe, IBM Vice President of Strategic Alliances, and Raejeanne Skillern, Intel Vice President of Data Center Group and GM, discussed how clients in this new era of innovation can apply data, technology, plus human ingenuity to springboard to advance new business value and opportunities.
Discussions of cloud computing have evolved in recent years from a focus on specific types of cloud, to a world of hybrid cloud, and to a world dominated by the APIs that make today's multi-cloud environments and hybrid clouds possible. In this Power Panel at 17th Cloud Expo, moderated by Conference Chair Roger Strukhoff, panelists addressed the importance of customers being able to use the specific technologies they need, through environments and ecosystems that expose their APIs to make true change and transformation possible.
The current age of digital transformation means that IT organizations must adapt their toolset to cover all digital experiences, beyond just the end users’. Today’s businesses can no longer focus solely on the digital interactions they manage with employees or customers; they must now contend with non-traditional factors. Whether it's the power of brand to make or break a company, the need to monitor across all locations 24/7, or the ability to proactively resolve issues, companies must adapt to the new world.
In his session at 20th Cloud Expo, Scott Davis, CTO of Embotics, discussed how automation can provide the dynamic management required to cost-effectively deliver microservices and container solutions at scale. He also discussed how flexible automation is the key to effectively bridging and seamlessly coordinating both IT and developer needs for component orchestration across disparate clouds – an increasingly important requirement at today’s multi-cloud enterprise.