{"id":2990,"date":"2021-02-05T17:03:38","date_gmt":"2021-02-05T16:03:38","guid":{"rendered":"https:\/\/laurentvanacker.com\/?p=2990"},"modified":"2022-12-09T09:50:11","modified_gmt":"2022-12-09T08:50:11","slug":"powershell-7-remoting-windows-10-linux-ubuntu","status":"publish","type":"post","link":"https:\/\/laurentvanacker.com\/index.php\/2021\/02\/05\/powershell-7-remoting-windows-10-linux-ubuntu\/","title":{"rendered":"PowerShell (7+) : Remoting Windows (10) <--> Linux (Ubuntu)"},"content":{"rendered":"<p><a href=\"#en-us\" name=\"fr-fr\">Go to English version<\/a><\/p>\n<p>Il existe de nombreux articles sur Internet qui expliquent le remoting PowerShell entre Windows et Linux et je propose ici d&rsquo;en faire une synth\u00e8se qui vous permettra de construire votre propre environnement de tests gr\u00e2ce \u00e0 <a href=\"https:\/\/github.com\/AutomatedLab\/AutomatedLab\" target=\"_blank\" rel=\"noopener noreferrer\">AutomatedLab<\/a> et Hyper-V (par extension \u00e0 Azure \u00e9galement avec peu de modifications) et de vous connecter sans mot de passe via du PowerShell Remoting (via du SSH Tunneling) entre les machines Windows et Linux (dans les deux sens)<\/p>\n<p>Nous aurons besoin d&rsquo;une machine Windows 10. Je vous propose d&rsquo;utiliser le lab AutomatedLab\u00a0 <a href=\"https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Powershell\/AutomatedLab%20-%20PoshCore.ps1\">suivant<\/a> (Domaine contoso.com avec un cotr\u00f4leur de domaine (DC01 &#8211; Windows Server 2019) et une machine cliente WIN10 (Windows 10). Le nom WIN10 est utilis\u00e9 dans les scripts utilis\u00e9s dans cet article.<\/p>\n<p>Nous aurons \u00e9galement besoin d&rsquo;une machine sous Linux. Je vous propose de vous r\u00e9f\u00e9rer au lien suivant <a href=\"https:\/\/www.thomasmaurer.ch\/2019\/06\/how-to-create-an-ubuntu-vm-on-windows-10\/\">How to create an Ubuntu VM on Windows 10 &#8211; Thomas Maurer<\/a> qui explique tr\u00e8s bien comment en avoir une rapidement gr\u00e2ce \u00e0 la fonction \u00ab\u00a0Quick Create\u00a0\u00bb d&rsquo;Hyper-V.<\/p>\n<p>Lors de la r\u00e9daction initiale de cet article j&rsquo;ai choisi la version 18.04.3 d&rsquo;Ubuntu qui prenait en charge le mode \u00ab\u00a0Enhanced Session\u00a0\u00bb d&rsquo;Hyper-V (ce n&rsquo;\u00e9tait pas encore le cas pour la 20.04) et j&rsquo;ai appel\u00e9 la machine UBUNTU (nom utilis\u00e9 dans les scripts utilis\u00e9s dans cet article).<\/p>\n<p>Mes machines WIN10 et UBUNTU sont toutes deux connect\u00e9es au \u00ab\u00a0Default Switch\u00a0\u00bb d&rsquo;Hyper-V (disponible sous Hyper-V\/Windows 10)<\/p>\n<p>Pour des raisons de simplicit\u00e9 j&rsquo;ai choisi les m\u00eames comptes et mot de passe sur les deux environnements (administrator \/ P@ssw0rd)<\/p>\n<p>Si vous souhaitez prendre la machine UBUNTU en RDP, il suffit de modifier l&rsquo;entr\u00e9e suivante dans le fichier \/etc\/xrdp.ini (Plus de d\u00e9tails <a href=\"https:\/\/github.com\/neutrinolabs\/xrdp\/issues\/1260\">ici<\/a>) : use_vsock=true ==&gt; use_vsock=false et de red\u00e9marrer la machine UBUNTU. Ensuite vous pourrez utiliser RDP (attention \u00e0 ne pas avoir un client Hyper-V Virtual Machine Connection ouvert en m\u00eame temps).\u00a0 Si vous souhaitez utiliser RDCMan (et ce malgr\u00e9 la faille <a href=\"https:\/\/msrc.microsoft.com\/update-guide\/en-US\/vulnerability\/CVE-2020-0765\">CVE-2020-0765 &#8211; Security Update Guide &#8211; Microsoft &#8211; Remote Desktop Connection Manager Information Disclosure Vulnerability)<\/a> j&rsquo;ai mis \u00e0 disposition le fichier <a href=\"https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Powershell\/AutomatedLab%20-%20PoshCore.rdg\">suivant<\/a> qui se connecte aux trois machines (DC01, WIN10 et UBUNTU) en RDP.<\/p>\n<p>Une fois les trois machines en place (et inter-connect\u00e9es), il suffit de d\u00e9rouler les scripts suivants :<\/p>\n<ul>\n<li><strong>Pour une connexion WIN10 ==&gt; UBUNTU<\/strong>\n<ol>\n<li>Sur UBUNTU : <a href=\"https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Powershell\/Remoting%20over%20SSH\/1%20-%20From%20Windows%20To%20Ubuntu\/1%20-%20Ubuntu\/Install-SSH-PowerShellCore.sh\">Install-SSH-PowerShellCore.sh<\/a>\n<ul>\n<li><strong>Note:<\/strong> Vous pouvez faire un copier\/coller du fichier gr\u00e2ce \u00e0 RDP et ensuite faire un chmod +x pour avoir les droits d&rsquo;ex\u00e9cution).<\/li>\n<li>\u00a0Ce script effectue les t\u00e2ches suivantes\n<ul>\n<li>Mise \u00e0 jour des composants de l&rsquo;OS.<\/li>\n<li>Installation de OpenSSH client et server<\/li>\n<li>Autorisation du flux SSH au niveau du Firewall<\/li>\n<li>Installation automatis\u00e9e de PowerShell via le script\u00a0 <a href=\"https:\/\/aka.ms\/install-powershell.sh\">https:\/\/aka.ms\/install-powershell.sh<\/a><\/li>\n<li>Modification du fichier \/etc\/ssh\/sshd_config pour\n<ul>\n<li>Mise \u00e0 jour des param\u00e8tres PubkeyAuthentication, PasswordAuthentication et RSAAuthentication \u00e0 yes.<\/li>\n<li>Rajout du sous-syst\u00e8me PowerShell<\/li>\n<\/ul>\n<\/li>\n<li>Red\u00e9marrage du service SSH.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Sur WIN10 : <a href=\"https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Powershell\/Remoting%20over%20SSH\/1%20-%20From%20Windows%20To%20Ubuntu\/2%20-%20Windows\/Install-OpenSSH-PowerShellCore.ps1\">Install-OpenSSH-PowerShellCore.ps1<\/a>\n<ul>\n<li>Ce script effectue les t\u00e2ches suivantes\n<ul>\n<li>Installation de OpenSSH client et server<\/li>\n<li>Installation automatis\u00e9e de PowerShell via le script <a href=\"https:\/\/aka.ms\/install-powershell.ps1\">https:\/\/aka.ms\/install-powershell.ps1<\/a><\/li>\n<li>Cr\u00e9ation d&rsquo;un lien symbolique C:\\pwsh vers le r\u00e9pertoire d&rsquo;installation de PowerShell 7+ (\u00e0 cause des espaces du r\u00e9pertoire de base &#8211; Normalement C:\\Program Files\\PowerShell &#8230;)<\/li>\n<li>Configuration du service SSH en automatique et d\u00e9marrage.<\/li>\n<li>Autorisation du flux SSH au niveau du Firewall<\/li>\n<li>Modification du fichier %ProgramData%\\ssh\\sshd_config file pour\n<ul>\n<li>Mise \u00e0 jour des param\u00e8tres PubkeyAuthentication, PasswordAuthentication et RSAAuthentication \u00e0 yes.<\/li>\n<li>Rajout du sous-syst\u00e8me PowerShell<\/li>\n<\/ul>\n<\/li>\n<li>Modification de la configuration du fichier ssh_config pour d\u00e9sactiver le fichier administrators_authorized_keys d\u00e9di\u00e9 aux administrateurs\u00a0 comme expliqu\u00e9 sur <a href=\"https:\/\/stackoverflow.com\/questions\/16212816\/setting-up-openssh-for-windows-using-public-key-authentication\">https:\/\/stackoverflow.com\/questions\/16212816\/setting-up-openssh-for-windows-using-public-key-authentication<\/a><\/li>\n<li>Red\u00e9marrage du service SSH<\/li>\n<li>G\u00e9n\u00e9ration des cl\u00e9s SSH : Le mot de passe du compte administrator sur UBUNTU vous sera demand\u00e9 deux fois (et plus jamais apr\u00e8s) pour la configuration des cl\u00e9s SSH sur cette machine<\/li>\n<li>Une ligne de commandes sera copi\u00e9e dans le presse-papiers qu&rsquo;il faudra ensuite coller dans la fen\u00eatre\u00a0 PowerShell (7+) qui s&rsquo;ouvrira. Le r\u00e9sultat sera le suivant :<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2991 aligncenter\" src=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Ubuntu_PWSH.png\" alt=\"\" width=\"978\" height=\"230\" srcset=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Ubuntu_PWSH.png 978w, https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Ubuntu_PWSH-300x71.png 300w, https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Ubuntu_PWSH-768x181.png 768w\" sizes=\"auto, (max-width: 978px) 100vw, 978px\" \/><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>Pour une connexion UBUNTU ==&gt; UBUNTU (L&rsquo;\u00e9tape pr\u00e9c\u00e9dente \u00e9tant un pr\u00e9requis)<\/strong>\n<ol>\n<li>Sur UBUNTU : <a href=\"https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Powershell\/Remoting%20over%20SSH\/2%20-%20From%20Ubuntu%20To%20Windows\/1%20-%20Ubuntu\/Configure-SSH.sh\">Configure-SSH.sh<\/a>\n<ol>\n<li><strong>Note:<\/strong> Vous pouvez faire un copier\/coller du fichier gr\u00e2ce \u00e0 RDP et ensuite faire un chmod +x pour avoir les droits d&rsquo;ex\u00e9cution).<\/li>\n<li>Ce script effectue les t\u00e2ches suivantes\n<ul>\n<li>G\u00e9n\u00e9ration des cl\u00e9s SSH : Le mot de passe du compte administrator sur WIN10 vous sera demand\u00e9 deux fois (et plus jamais apr\u00e8s) pour la configuration des cl\u00e9s SSH sur cette machine<\/li>\n<li>Appropriation (via chown) du fichier\u00a0 ~\/.local\/share\/powershell\/PSReadLine\/ConsoleHost_history.txt pour \u00e9viter un access denied<\/li>\n<li>Une ligne de commandes sera copi\u00e9e dans le presse-papiers qu&rsquo;il faudra ensuite coller dans la fen\u00eatre\u00a0 PowerShell (7+) qui s&rsquo;ouvrira. Il faudra r\u00e9pondre &lsquo;yes&rsquo; \u00e0 la question demand\u00e9e.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2992 aligncenter\" src=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Authenticity.png\" alt=\"\" width=\"736\" height=\"116\" srcset=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Authenticity.png 736w, https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Authenticity-300x47.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Le r\u00e9sultat sera le suivant :<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2994 aligncenter\" src=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/Ubuntu_WIN10_PWSH.png\" alt=\"\" width=\"730\" height=\"156\" srcset=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/Ubuntu_WIN10_PWSH.png 730w, https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/Ubuntu_WIN10_PWSH-300x64.png 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/p>\n<p>Vous avez maintenant configur\u00e9 le PowerShell (7+) Remoting via du SSH Tunneling entre Windows et Ubuntu dans les deux sens\u00a0\ud83d\ude42<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/laurentvanacker.com\/wp-content\/uploads\/2017\/01\/012717_1333_Fusionnerde1.png\" alt=\"\" \/><\/p>\n<p><a href=\"#fr-FR\" name=\"en-us\">Aller \u00e0 la version fran\u00e7aise<\/a><\/p>\n<p><span class=\"VIiyi\" lang=\"en\"><span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"en\" data-language-to-translate-into=\"fr\" data-phrase-index=\"0\">There are many articles on the Internet that explain PowerShell remoting between Windows and Linux and I propose here to summarize it that will allow you to build your own test environment thanks to <a href=\"https:\/\/github.com\/AutomatedLab\/AutomatedLab\" target=\"_blank\" rel=\"noopener noreferrer\">AutomatedLab<\/a> and Hyper-V (by extension to Azure also with few modifications) and connect without password via PowerShell Remoting (via SSH Tunneling) between Windows and Linux machines (in both directions) <\/span><\/span><\/p>\n<p>We will need a Windows 10 machine. I suggest you use the\u00a0following\u00a0AutomatedLab <a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Powershell\/AutomatedLab%2520-%2520PoshCore.ps1\">lab<\/a>\u00a0(Contoso.com domain with a domain controller (DC01 &#8211; Windows Server 2019) and a WIN10 client machine (Windows 10). The name WIN10 is used in the scripts used in this article.<\/p>\n<p>We will also need a machine running Linux.\u00a0<span class=\"\">I suggest you refer to the following link\u00a0<\/span><a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/www.thomasmaurer.ch\/2019\/06\/how-to-create-an-ubuntu-vm-on-windows-10\/\"><span class=\"\">How to create an Ubuntu VM on Windows 10 &#8211; Thomas Maurer<\/span><\/a><span class=\"\">\u00a0which explains very well how to have one quickly thanks to the \u201cQuick Create\u201d function of Hyper-V.<\/span><\/p>\n<p>During the initial writing of this article I chose Ubuntu version 18.04.3 which supported Hyper-V \u201cEnhanced Session\u201d mode (this was not yet the case for 04.20) and I called the machine UBUNTU (name used in the scripts used in this article).<\/p>\n<p>My WIN10 and UBUNTU machines are both connected to the Hyper-V \u201cDefault Switch\u201d (available under Hyper-V \/ Windows 10)<\/p>\n<p>For reasons of simplicity I chose the same accounts and password on both environments (administrator \/ P@ssw0rd)<\/p>\n<p>If you want to take the UBUNTU machine with RDP, just modify the following entry in the \/etc\/xrdp.ini file (More details <a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/github.com\/neutrinolabs\/xrdp\/issues\/1260\">here<\/a>\u00a0): use_vsock = true ==&gt; use_vsock = false and restart the UBUNTU machine.\u00a0Then you can use RDP (be careful not to have a Hyper-V Virtual Machine Connection client open at the same time).\u00a0If you want to use RDCMan (despite the flaw\u00a0<a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/msrc.microsoft.com\/update-guide\/en-US\/vulnerability\/CVE-2020-0765\">CVE-2020-0765 &#8211; Security Update Guide &#8211; Microsoft &#8211; Remote Desktop Connection Manager Information Disclosure Vulnerability)<\/a>\u00a0I have made available the\u00a0<a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Powershell\/AutomatedLab%2520-%2520PoshCore.rdg\">following<\/a>\u00a0file\u00a0which connects to the three machines (DC01, WIN10 and UBUNTU) with RDP.<\/p>\n<p><span class=\"VIiyi\" lang=\"en\"><span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"en\" data-language-to-translate-into=\"fr\" data-phrase-index=\"0\">Once the three machines are in place (and interconnected), all you have to do is run the following scripts:<\/span><\/span><\/p>\n<ul>\n<li><strong><span class=\"\">For a WIN10 connection ==&gt; UBUNTU<\/span><\/strong><\/li>\n<\/ul>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>On UBUNTU:\u00a0<a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Powershell\/Remoting%2520over%2520SSH\/1%2520-%2520From%2520Windows%2520To%2520Ubuntu\/1%2520-%2520Ubuntu\/Install-SSH-PowerShellCore.sh\">Install-SSH-PowerShellCore.sh<\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>Note:<\/strong>\u00a0You can copy \/ paste the file using RDP and then do a chmod + x to have execution rights).<\/li>\n<li>\u00a0This script performs the following tasks\n<ul>\n<li>Update of OS components.<\/li>\n<li>Installation of OpenSSH client and server<\/li>\n<li>Authorization of SSH traffic at the Firewall level<\/li>\n<li>Automated PowerShell installation via\u00a0<a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/aka.ms\/install-powershell.sh\">https:\/\/aka.ms\/install-powershell.sh<\/a>\u00a0script<\/li>\n<li>Modification of the \/etc\/ssh\/sshd_config file\n<ul>\n<li>Updating PubkeyAuthentication, PasswordAuthentication, and RSAAuthentication settings to yes.<\/li>\n<li>Adding the PowerShell Subsystem<\/li>\n<\/ul>\n<\/li>\n<li>Restarting the SSH service.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li><span class=\"VIiyi\" lang=\"en\"><span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"en\" data-language-to-translate-into=\"fr\" data-phrase-index=\"0\">On WIN10:\u00a0<a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Powershell\/Remoting%2520over%2520SSH\/1%2520-%2520From%2520Windows%2520To%2520Ubuntu\/2%2520-%2520Windows\/Install-OpenSSH-PowerShellCore.ps1\">Install-OpenSSH-PowerShellCore.ps1<\/a><\/span><\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<ol>\n<li style=\"list-style-type: none;\"><\/li>\n<\/ol>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>This script performs the following tasks\n<ul>\n<li>Installation of OpenSSH client and server<\/li>\n<li>Automated installation of PowerShell via the script\u00a0<a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/aka.ms\/install-powershell.ps1\">https:\/\/aka.ms\/install-powershell.ps1<\/a><\/li>\n<li>Creation of a symbolic link C:\\pwsh to the installation directory of PowerShell 7+ (because of the spaces in the home directory &#8211; Normally C: \\ Program Files \\ PowerShell\u2026)<\/li>\n<li>Configuration of the SSH service to automatic startup and startup.<\/li>\n<li>Authorization of SSH traffic at the Firewall level<\/li>\n<li>Modification of the %ProgramData%\\ssh\\sshd_config file\n<ul>\n<li>Updating PubkeyAuthentication, PasswordAuthentication, and RSAAuthentication settings to yes.<\/li>\n<li>Adding of the PowerShell subsystem<\/li>\n<\/ul>\n<\/li>\n<li>Modification of the configuration of the ssh_config file to disable the administrators_authorized_keys file dedicated to administrators as explained on\u00a0<a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/stackoverflow.com\/questions\/16212816\/setting-up-openssh-for-windows-using-public-key-authentication\">https:\/\/stackoverflow.com\/questions\/16212816\/setting-up-openssh-for-windows-using-public-key-authentication<\/a><\/li>\n<li>Restarting the SSH service<\/li>\n<li>Generation of SSH keys: You will be asked for the password of the administrator account on UBUNTU twice (and never after) for the configuration of the SSH keys on this machine<\/li>\n<li>A command line will be copied to the clipboard which will then have to be pasted in the PowerShell (7+) window that will open.\u00a0The result will be as follows:<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2991 aligncenter\" src=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Ubuntu_PWSH.png\" alt=\"\" width=\"978\" height=\"230\" srcset=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Ubuntu_PWSH.png 978w, https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Ubuntu_PWSH-300x71.png 300w, https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Ubuntu_PWSH-768x181.png 768w\" sizes=\"auto, (max-width: 978px) 100vw, 978px\" \/><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><span class=\"VIiyi\" lang=\"en\"><span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"en\" data-language-to-translate-into=\"fr\" data-phrase-index=\"0\"><strong>For a UBUNTU ==&gt; UBUNTU connection (The previous step being a prerequisite)<\/strong><\/span><\/span><\/li>\n<\/ul>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>On UBUNTU:\u00a0<a href=\"https:\/\/translate.google.com\/website?sl=fr&amp;tl=en&amp;u=https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Powershell\/Remoting%2520over%2520SSH\/2%2520-%2520From%2520Ubuntu%2520To%2520Windows\/1%2520-%2520Ubuntu\/Configure-SSH.sh\">Configure-SSH.sh<\/a>\n<ol>\n<li><strong>Note:<\/strong>\u00a0You can copy \/ paste the file using RDP and then do a chmod + x to have execution rights).<\/li>\n<li>This script performs the following tasks\n<ul>\n<li><span class=\"\">Generation of SSH keys: You will be asked for the password of the administrator account on WIN10 twice (and never after) for the configuration of the SSH keys on this machine<\/span><\/li>\n<li>Appropriation (via chown) of the ~\/.local\/share\/powershell\/PSReadLine\/ConsoleHost_history.txt file to avoid access denied<\/li>\n<li>A command line will be copied to the clipboard which will then have to be pasted in the PowerShell (7+) window that will open.\u00a0You must answer &lsquo;yes&rsquo; to the question asked.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2992 aligncenter\" src=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Authenticity.png\" alt=\"\" width=\"736\" height=\"116\" srcset=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Authenticity.png 736w, https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/WIN10_Authenticity-300x47.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>The result will be as follows:<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2994 aligncenter\" src=\"https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/Ubuntu_WIN10_PWSH.png\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" srcset=\"https:\/\/eibcctqlex5stey3zfuyzwpjdi--laurentvanacker-com.translate.goog\/wp-content\/uploads\/2021\/02\/Ubuntu_WIN10_PWSH.png 730w,https:\/\/eibcctqlex5stey3zfuyzwpjdi--laurentvanacker-com.translate.goog\/index.php\/2021\/02\/05\/powershell-7-remoting-windows-10-linux-ubuntu\/ https:\/\/laurentvanacker.com\/wp-content\/uploads\/2021\/02\/Ubuntu_WIN10_PWSH-300x64.png 300w\" alt=\"\" width=\"730\" height=\"156\" \/><\/p>\n<p>You have now configured the PowerShell (7+) Remoting via SSH Tunneling between Windows and Ubuntu in both directions\u00a0\ud83d\ude42<\/p>\n<p>Laurent.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go to English version Il existe de nombreux articles sur Internet qui expliquent le remoting PowerShell entre Windows et Linux et je propose ici d&rsquo;en [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":2463,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57,19],"tags":[54,58,39,59],"class_list":["post-2990","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-powershell","tag-automatedlab","tag-linux","tag-powershell","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts\/2990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/comments?post=2990"}],"version-history":[{"count":8,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts\/2990\/revisions"}],"predecessor-version":[{"id":3002,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts\/2990\/revisions\/3002"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/media\/2463"}],"wp:attachment":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/media?parent=2990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/categories?post=2990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/tags?post=2990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}