You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need an Enable-SSHRemoting cmdlet, similar to existing Enable-PSSession cmdlet for WinRM based remoting, to set up SSH remoting on supported platforms. This would make using SSH remoting easier to use and also allow automated testing of SSH remoting.
I think what we may end up doing is just having a setup script in the demo folder and we can blog about it to inform users of it's existence who don't work out of GitHub
I am working on a set up script right now as a prototype for the Cmdlet. I don't think we should worry about Win32-OpenSSH breaking PowerShell remoting since it is intended to be closely compatible with other platform versions of SSH.
Two years later I'm still hoping this is implemented. I just had to write PS scripts to do this while provisioning Windows 7 and Windows 10 PCs. For windows 10 I followed several articles on docs.microsoft.com [1][2]. For Windows 7 I used chocolatey.
PowerShell SSH remoting was implemented in PowerShell 6.0 but requries SSH (client) and SSHD (service) components
to be installed. In addition the sshd_config configuration file must be updated to define a PowerShell endpoint
as a subsystem. Once this is done PowerShell remoting cmdlets can be used to establish a PowerShell remoting
session over SSH that works across platforms.
There are a number of requirements that must be satisfied for PowerShell SSH based remoting:
a. PowerShell 6.0 or greater must be installed on the system.
Since multiple PowerShell installations can appear on a single system, a specific installation can be selected.
b. SSH client must be installed on the system as PowerShell uses it for outgoing connections.
c. SSHD (ssh daemon) must be installed on the system for PowerShell to receive SSH connections.
d. SSHD must be configured with a Subsystem that serves as the PowerShell remoting endpoint.
The Enable-SSHRemoting cmdlet will do the following:
a. Detect the underlying platform (Windows, Linux, macOS).
b. Detect an installed SSH client, and emit a warning if not found.
c. Detect an installed SSHD daemon, and emit a warning if not found.
d. Accept a PowerShell (pwsh) path to be run as a remoting PowerShell session endpoint.
Or try to use the currently running PowerShell.
e. Update the SSHD configuration file to add a PowerShell subsystem endpoint entry.
If all of the conditions are satisfied then PowerShell SSH remoting will work to and from the local system.
Activity
RichardSiddaway commentedon Apr 21, 2017
Agreed
Configuring SSH for remoting is tsk that is better automated if at all possible
2 remaining items
SteveL-MSFT commentedon Aug 28, 2017
I think what we may end up doing is just having a setup script in the demo folder and we can blog about it to inform users of it's existence who don't work out of GitHub
PaulHigin commentedon Aug 28, 2017
I am working on a set up script right now as a prototype for the Cmdlet. I don't think we should worry about Win32-OpenSSH breaking PowerShell remoting since it is intended to be closely compatible with other platform versions of SSH.
SteveL-MSFT commentedon Sep 21, 2017
I think we can publish this in PowerShellGallery initially and target inclusion in the package for 6.1.0
soul4soul commentedon Dec 6, 2019
Two years later I'm still hoping this is implemented. I just had to write PS scripts to do this while provisioning Windows 7 and Windows 10 PCs. For windows 10 I followed several articles on docs.microsoft.com [1][2]. For Windows 7 I used chocolatey.
For configuring the keys I followed the guide at https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement. It'd be nice to see
Repair-AuthorizedKeyPermissionfixed with this effort too.SteveL-MSFT commentedon Dec 9, 2019
Paul Higinbotham (@PaulHigin) has a working version, just need to publish to PSGallery. Won't be in PS7, but can be in 7.1.
PaulHigin commentedon Feb 5, 2020
A version 0.1.0 of PowerShell remoting tools module has been published, and which contains the Enable-SSHRemoting cmdlet.
https://www.powershellgallery.com/packages/Microsoft.PowerShell.RemotingTools/0.1.0