question

JackChuong-4469 avatar image
0 Votes"
JackChuong-4469 asked ClementBETACORNE answered

How to enable powershell remoting on Windows server standalone for Ubuntu client

Hi all,
Here my case:
A workgroup Windows server 2016 standard as web server for .NET websites
A .NET project on gitlab.
I want to implement gitlab ci/cd for .NET project so it can build and upload new binary to Windows server, restart web app pool automatically. What I did:
- Enable ssh + powershell remoting + Just Enough Admin on windows server .
- gilab runner (Ubuntu base image) ssh to windows server and do the rest as ci/cd script.

I made it worked with a joined domain windows server but with a workgroup server I got stuck.
Ubuntu client cannot run command

 Enter-PSSession -ComputerName 10.17.28.50 -ConfigurationName gitlabJEA -Credential $nonAdminCred

Because : "-Kerberos accepts domain user, but not local user"
To bypass it I have to add the server's IP to the trusted hosts on Windows 10 client :

 Enable-PSRemoting -SkipNetworkProfileCheck -Force
 Set-Item WSMan:\localhost\Client\TrustedHosts -Value '*'

So I guess I have to do same on Ubuntu client ? How can I did that ? Should I install powershell on Ubuntu client as this instruction ? https://adamtheautomator.com/psremoting-linux/
I know it would be easier if I join windows server to domain but I just want to try , please give me some advice, thank you very much.

windows-server-powershellwindows-server-2016
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ClementBETACORNE avatar image
0 Votes"
ClementBETACORNE answered

Hello,

Below you will find the official documentation of Microsoft regarding PowerShell Remoting over SSH if that's help :
https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/ssh-remoting-in-powershell-core?view=powershell-7.2

Regards,

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.