Work remotely (Run Linux GUI applications remotely from Windows through firewall :D)
Motive: I want to execute X windows application of remote Linux machine from local Windows 10. It is assumed that the remote machine is located behind of firewall or NAT. However, I intentionally omitted many things for being cautious, and I just wanna give a hint rather than answer. I think you know what I say. :D
[local] Install and run openssh server for Windows 10
Installation of OpenSSH For Windows Server | Microsoft Docs
To install OpenSSH, start Settings then go to Apps > Apps and Features > Manage Optional Features
To configure the OpenSSH server for initial use on Windows, launch PowerShell as an administrator, then run the following commands to start the SSHD service:
Start-Service sshd
# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'
# Confirm the Firewall rule is configured. It should be created automatically by setup.
Get-NetFirewallRule -Name *ssh*
# There should be a firewall rule named "OpenSSH-Server-In-TCP", which should be enabled
# If the firewall does not exist, create one
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
[remote] Establish reverse SSH tunnel
ssh -X -R 5252:127.0.0.1:22 [user]@[ip] -p [port]
- ‘ip’ is a public IP address or hostname of Windows machine.
- ‘port’ is a your openssh server’s port number. If you are using default and your system is using public IP address, this argument is not needed.
If you are using NAT devices, you need to make a ‘port fowarding’ mapping in your router(NAT) for the ‘port’.
[local] Install mobaXterm
MobaXterm free Xserver and tabbed SSH client for Windows (mobatek.net)
[local] Make a session in mobaXterm
hostname: localhost
port: 5252
DONE. (maybe? :D)