Use SSH & X11 forwarding on Windows: Difference between revisions
(Created page with "This page explain the procedure to enable X11 forwarding with SSH on Windows 10 & 11 using Powershell or WSL. ==Powershell== PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language.<br> Since version 5.1 Powershell includes open-ssh utility allowing user to use it to connect to SSH without the need of a third party software. ===Prerequities=== *A device running at l...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 43: | Line 43: | ||
Now connect to SSH server using '''-X''' argument : | Now connect to SSH server using '''-X''' argument : | ||
<pre>ssh username@hostname - | <pre>ssh username@hostname -XY</pre> | ||
X11 forwarding is now enabled on Powershell. | X11 forwarding is now enabled on Powershell. | ||
Latest revision as of 13:16, 8 November 2023
This page explain the procedure to enable X11 forwarding with SSH on Windows 10 & 11 using Powershell or WSL.
Powershell
PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language.
Since version 5.1 Powershell includes open-ssh utility allowing user to use it to connect to SSH without the need of a third party software.
Prerequities
- A device running at least Windows Server 2019,Windows 10 (build 1809) or later.
- PowerShell 5.1 or later.
Creating SSH keypair
Start Powershell using shortcut windows key + X, then type the following command to create your key :
ssh-keygen -t ecdsa
Follow the steps to create your ECDSA SSH keypair.
Once the key are generated you need to install Xming
Installing Xming
Get the installer from this page, then install it.
Note that you can install Xming using Chocolatey :
choco install xming -y
Ensure Xming is started before continuing.
Enabling x11 forwarding
Start Powershell and paste the following command :
$env:DISPLAY= 'localhost:0.0'
(you need to type this command each time before using x11 forwarding.)
Now connect to SSH server using -X argument :
ssh username@hostname -XY
X11 forwarding is now enabled on Powershell.