Container running sshd with PowerShell Remoting Configured
(root password is 'SuperSecret')
This container will establish a PowerShell Remote session over SSH to both Linux and Windows machines running PowerShell Core. Windows must be setup up properly to allow this.
docker run --rm -it -name psremote1 -p 555:22 jbonds/ssh-powershell-remoting
To connect to the container using a port other than default 22, you must define the port in your profile's ssh config file which will direct your ssh client to connect using the port specified.
"config" file example:
Once you have this defined you can connect to the container as normal:
$container = New-Pssession -Hostname 126.96.36.199 -UserName root
$container = New-Pssession -Hostname 188.8.131.52 -SSHTransport -UserName root
The container can also connect to a non-container host. If the host is not configured to use a different port, there is no need to edit the config file. Connect as normal over port 22.