Remoting with OpenSSH
We saw in Chapter 12, Securing PowerShell, that remoting was a powerful way to establish a connection with a machine and take control. When we looked at remoting in that chapter, we explored remoting over the Windows Remote Management (WinRM) protocol on other Windows machines. We mentioned that we could also use SSH to establish remote sessions. Linux does not support the WinRM protocol, so we must use SSH to remotely administer it.
OpenSSH is an open source SSH toolset that is almost ubiquitous on Linux and other Unix machines. Since 2018, it has been available for Windows and makes managing heterogeneous environments much easier. It can be a bit tricky to set up, but once it is working, it makes remoting very easy. Let’s take a look.
Checking that PowerShell has OpenSSH support
The first thing to check is that our version of PowerShell 7 has got OpenSSH support; if we’ve downloaded and installed it from GitHub, then we should be OK, but...