I want to run Nano Server in a Virtualbox virtual machine in a Linux host, but it seems that Nano Server only accepts access via WinRM using PowerShell.
I would prefer to find a way to access via ssh as it's possible with other Windows to incorporate tasks with this machine in my automation in Linux environment.
How can I access Nano Server via ssh?
Is there a clever workaround?
There is a powershell module called
Posh-SSH
. If you install the module you've a New-SSHSession cmdlet. See this link. Based on this you can SSH to your Nano Server installation. To add SSH server capability to Nano Server you've to install Win32-OpenSSH (the link points to the install instructions).You'll want to setup and install OpenSSH on the nano server. Unfortunately, you'll have to initially do it via the Powershell remoting shell.
https://techcommunity.microsoft.com/t5/itops-talk-blog/installing-and-configuring-openssh-on-windows-server-2019/ba-p/309540
Basically, the article outlines: