Automated SSH Install for Nano Server

Automated SSH Install for Nano Server

The Microsoft PowerShell team has been working hard on their port of the open source SSH tools.

The admittedly rough installation instructions call for many manual steps and for using at least one 32-bit tool that does not run on Nano which does not have 32-bit support (WOW64).

Since March I have been doing a Chocolatey NuGet package that installs SSH - including installing the server if desired.

I thought it might be nice if this work was directly re-usable on Nano - even though Nano can’t currently run Chocolatey. So last weekend I completed code changes that allow for exactly that.

The result is a dual-purpose Chocolatey package. It works as a full Chocolatey package on systems that meet the requirements to install and use chocolatey packages. However, it also works without installing chocolatey at all.

The long term benefit will be that as the Chocolatey package is kept up to date with Win32-OpenSSH releases, the Nano install script will be as well.

FYI: Nano Server support is on the Chocolatey roadmap and when this support is introduced, the Win32-OpenSSH chocolatey package will be ready to go.

Here is a brief summary of the instructions:

  1. Download the Win32-OpenSSH .nupkg file by clicking “Download” on the left navigation bar of it’s chocolate package page (https://chocolatey.org/packages/win32-openssh) Note: Must be version 2016.05.30.20160908 or later of the package.

  2. Expand the chocolatey package (rename it to end in .zip and use any unzipping tool).

  3. From the expanded files, copy the \tools folder to the target system to be configured. Note: For Nano Server you will need to use “Copy-Item " with the “-ToSession” parameter.

  4. Open a command prompt on the target system and change to the tools folder (this requires PS remoting for Nano).

  5. Run '..\tools\barebonesinstaller.ps1 -SSHServerFeature' to install.

  6. To uninstall run '..\tools\barebonesinstaller.ps1 -SSHServerFeature -Uninstall'

The above instructions and some additional details are contained in the help of the barebonesinstaller.ps1