How to make PowerShell Core remoting work?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


.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?







share|improve this question





















  • 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

















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?







share|improve this question





















  • 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













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?







share|improve this question













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?









share|improve this question












share|improve this question




share|improve this question








edited 15 hours ago









GAD3R

1,461620




1,461620









asked 17 hours ago









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

















  • 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











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!






share|improve this answer





















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    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






























    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!






    share|improve this answer

























      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!






      share|improve this answer























        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!






        share|improve this answer













        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!







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered 11 hours ago









        Ehouarn Perret

        1417




        1417






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491