How to make PowerShell Core remoting work?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
3
down vote
favorite
I have Kubuntu 18.04 installed on my machine and I installed PowerShell Core following the instructions given: Installing PowerShell core in linux.
I then setup the remoting following the steps described here: PowerShell remoting over SSH.
Even though the steps target Ubuntu 14.04, I could make my way through them.
But when I am trying something as simple as executing something on my own machine through remoting I get:
PS /etc/ssh> Invoke-Command -ComputerName ehouarn-perret-ThinkPad-E460 -ScriptBlock Write-Output Hello
Invoke-Command : MI_RESULT_ACCESS_DENIED
At line:1 char:1
+ Invoke-Command -ComputerName ehouarn-perret-ThinkPad-E460 -ScriptBloc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Command], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.InvokeCommandCommand
Any idea how to make the PowerShell Core remoting work with Ubuntu?
powershell
add a comment |Â
up vote
3
down vote
favorite
I have Kubuntu 18.04 installed on my machine and I installed PowerShell Core following the instructions given: Installing PowerShell core in linux.
I then setup the remoting following the steps described here: PowerShell remoting over SSH.
Even though the steps target Ubuntu 14.04, I could make my way through them.
But when I am trying something as simple as executing something on my own machine through remoting I get:
PS /etc/ssh> Invoke-Command -ComputerName ehouarn-perret-ThinkPad-E460 -ScriptBlock Write-Output Hello
Invoke-Command : MI_RESULT_ACCESS_DENIED
At line:1 char:1
+ Invoke-Command -ComputerName ehouarn-perret-ThinkPad-E460 -ScriptBloc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Command], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.InvokeCommandCommand
Any idea how to make the PowerShell Core remoting work with Ubuntu?
powershell
Your 2nd link requires to use[-HostName <string>] [-UserName <string>]
â LotPings
15 hours ago
@LotPings You're absolutely right! I thought it would have worked the same way as I am used to. Sorry for the noise!
â Ehouarn Perret
12 hours ago
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I have Kubuntu 18.04 installed on my machine and I installed PowerShell Core following the instructions given: Installing PowerShell core in linux.
I then setup the remoting following the steps described here: PowerShell remoting over SSH.
Even though the steps target Ubuntu 14.04, I could make my way through them.
But when I am trying something as simple as executing something on my own machine through remoting I get:
PS /etc/ssh> Invoke-Command -ComputerName ehouarn-perret-ThinkPad-E460 -ScriptBlock Write-Output Hello
Invoke-Command : MI_RESULT_ACCESS_DENIED
At line:1 char:1
+ Invoke-Command -ComputerName ehouarn-perret-ThinkPad-E460 -ScriptBloc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Command], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.InvokeCommandCommand
Any idea how to make the PowerShell Core remoting work with Ubuntu?
powershell
I have Kubuntu 18.04 installed on my machine and I installed PowerShell Core following the instructions given: Installing PowerShell core in linux.
I then setup the remoting following the steps described here: PowerShell remoting over SSH.
Even though the steps target Ubuntu 14.04, I could make my way through them.
But when I am trying something as simple as executing something on my own machine through remoting I get:
PS /etc/ssh> Invoke-Command -ComputerName ehouarn-perret-ThinkPad-E460 -ScriptBlock Write-Output Hello
Invoke-Command : MI_RESULT_ACCESS_DENIED
At line:1 char:1
+ Invoke-Command -ComputerName ehouarn-perret-ThinkPad-E460 -ScriptBloc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Command], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.InvokeCommandCommand
Any idea how to make the PowerShell Core remoting work with Ubuntu?
powershell
edited 15 hours ago
GAD3R
1,461620
1,461620
asked 17 hours ago
![](https://i.stack.imgur.com/aJgaF.png?s=32&g=1)
![](https://i.stack.imgur.com/aJgaF.png?s=32&g=1)
Ehouarn Perret
1417
1417
Your 2nd link requires to use[-HostName <string>] [-UserName <string>]
â LotPings
15 hours ago
@LotPings You're absolutely right! I thought it would have worked the same way as I am used to. Sorry for the noise!
â Ehouarn Perret
12 hours ago
add a comment |Â
Your 2nd link requires to use[-HostName <string>] [-UserName <string>]
â LotPings
15 hours ago
@LotPings You're absolutely right! I thought it would have worked the same way as I am used to. Sorry for the noise!
â Ehouarn Perret
12 hours ago
Your 2nd link requires to use
[-HostName <string>] [-UserName <string>]
â LotPings
15 hours ago
Your 2nd link requires to use
[-HostName <string>] [-UserName <string>]
â LotPings
15 hours ago
@LotPings You're absolutely right! I thought it would have worked the same way as I am used to. Sorry for the noise!
â Ehouarn Perret
12 hours ago
@LotPings You're absolutely right! I thought it would have worked the same way as I am used to. Sorry for the noise!
â Ehouarn Perret
12 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
As stated by LotPings:
Your 2nd link requires to use
[-HostName <string>] [-UserName <string>]
#
# Linux to Linux
#
$session = New-PSSession -HostName UbuntuVM1 -UserName TestUser
I tried:
ehouarn-perret@ehouarn-perret-ThinkPad-E460:/etc/ssh$ pwsh-preview
PowerShell 6.1.0-preview.4
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.
PS /etc/ssh> Invoke-Command -HostName ehouarn-perret-ThinkPad-E460 -UserName ehouarn-perret -ScriptBlock Write-Output Hello
The authenticity of host 'ehouarn-perret-thinkpad-e460 (127.0.1.1)' can't be established.
ECDSA key fingerprint is SHA256:woPvPaavotuV4g4K3fYXKXi78usIrboXm8+FIaJncOc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ehouarn-perret-thinkpad-e460' (ECDSA) to the list of known hosts.
ehouarn-perret@ehouarn-perret-thinkpad-e460's password:
Hello
PS /etc/ssh>
Seems it works like a charm, my bad!
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
As stated by LotPings:
Your 2nd link requires to use
[-HostName <string>] [-UserName <string>]
#
# Linux to Linux
#
$session = New-PSSession -HostName UbuntuVM1 -UserName TestUser
I tried:
ehouarn-perret@ehouarn-perret-ThinkPad-E460:/etc/ssh$ pwsh-preview
PowerShell 6.1.0-preview.4
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.
PS /etc/ssh> Invoke-Command -HostName ehouarn-perret-ThinkPad-E460 -UserName ehouarn-perret -ScriptBlock Write-Output Hello
The authenticity of host 'ehouarn-perret-thinkpad-e460 (127.0.1.1)' can't be established.
ECDSA key fingerprint is SHA256:woPvPaavotuV4g4K3fYXKXi78usIrboXm8+FIaJncOc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ehouarn-perret-thinkpad-e460' (ECDSA) to the list of known hosts.
ehouarn-perret@ehouarn-perret-thinkpad-e460's password:
Hello
PS /etc/ssh>
Seems it works like a charm, my bad!
add a comment |Â
up vote
1
down vote
As stated by LotPings:
Your 2nd link requires to use
[-HostName <string>] [-UserName <string>]
#
# Linux to Linux
#
$session = New-PSSession -HostName UbuntuVM1 -UserName TestUser
I tried:
ehouarn-perret@ehouarn-perret-ThinkPad-E460:/etc/ssh$ pwsh-preview
PowerShell 6.1.0-preview.4
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.
PS /etc/ssh> Invoke-Command -HostName ehouarn-perret-ThinkPad-E460 -UserName ehouarn-perret -ScriptBlock Write-Output Hello
The authenticity of host 'ehouarn-perret-thinkpad-e460 (127.0.1.1)' can't be established.
ECDSA key fingerprint is SHA256:woPvPaavotuV4g4K3fYXKXi78usIrboXm8+FIaJncOc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ehouarn-perret-thinkpad-e460' (ECDSA) to the list of known hosts.
ehouarn-perret@ehouarn-perret-thinkpad-e460's password:
Hello
PS /etc/ssh>
Seems it works like a charm, my bad!
add a comment |Â
up vote
1
down vote
up vote
1
down vote
As stated by LotPings:
Your 2nd link requires to use
[-HostName <string>] [-UserName <string>]
#
# Linux to Linux
#
$session = New-PSSession -HostName UbuntuVM1 -UserName TestUser
I tried:
ehouarn-perret@ehouarn-perret-ThinkPad-E460:/etc/ssh$ pwsh-preview
PowerShell 6.1.0-preview.4
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.
PS /etc/ssh> Invoke-Command -HostName ehouarn-perret-ThinkPad-E460 -UserName ehouarn-perret -ScriptBlock Write-Output Hello
The authenticity of host 'ehouarn-perret-thinkpad-e460 (127.0.1.1)' can't be established.
ECDSA key fingerprint is SHA256:woPvPaavotuV4g4K3fYXKXi78usIrboXm8+FIaJncOc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ehouarn-perret-thinkpad-e460' (ECDSA) to the list of known hosts.
ehouarn-perret@ehouarn-perret-thinkpad-e460's password:
Hello
PS /etc/ssh>
Seems it works like a charm, my bad!
As stated by LotPings:
Your 2nd link requires to use
[-HostName <string>] [-UserName <string>]
#
# Linux to Linux
#
$session = New-PSSession -HostName UbuntuVM1 -UserName TestUser
I tried:
ehouarn-perret@ehouarn-perret-ThinkPad-E460:/etc/ssh$ pwsh-preview
PowerShell 6.1.0-preview.4
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.
PS /etc/ssh> Invoke-Command -HostName ehouarn-perret-ThinkPad-E460 -UserName ehouarn-perret -ScriptBlock Write-Output Hello
The authenticity of host 'ehouarn-perret-thinkpad-e460 (127.0.1.1)' can't be established.
ECDSA key fingerprint is SHA256:woPvPaavotuV4g4K3fYXKXi78usIrboXm8+FIaJncOc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ehouarn-perret-thinkpad-e460' (ECDSA) to the list of known hosts.
ehouarn-perret@ehouarn-perret-thinkpad-e460's password:
Hello
PS /etc/ssh>
Seems it works like a charm, my bad!
answered 11 hours ago
![](https://i.stack.imgur.com/aJgaF.png?s=32&g=1)
![](https://i.stack.imgur.com/aJgaF.png?s=32&g=1)
Ehouarn Perret
1417
1417
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1062259%2fhow-to-make-powershell-core-remoting-work%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Your 2nd link requires to use
[-HostName <string>] [-UserName <string>]
â LotPings
15 hours ago
@LotPings You're absolutely right! I thought it would have worked the same way as I am used to. Sorry for the noise!
â Ehouarn Perret
12 hours ago