9.3. How to log into remote WSL from Windows using Terminal and FTP on GASVIEW?

If you need to securely access a remote Windows Subsystem for Linux (WSL) instance from another Windows system, you can use SSH (Terminal) and FTP (File Transfer Protocol) for command-line control and file management.

Prerequisites

  • Windows 10/11 with WSL installed and configured

  • Linux distribution installed in WSL (Ubuntu, Debian, etc.)

  • GASVIEW 1.0.9 installed on Windows

Step 1: Set Up SSH Server in WSL

  1. Launch WSL Open Command Prompt or PowerShell and run:

    wsl
  2. Install OpenSSH Server In your WSL terminal:

    sudo apt update && sudo apt install openssh-server gedit -y
  3. Configure SSH Server Edit the SSH configuration file:

    sudo gedit /etc/ssh/sshd_config

    Make these changes in this file:

    Port 22
    ListenAddress 0.0.0.0
    PasswordAuthentication yes

    Save and exit.

  4. Start SSH Service

    sudo service ssh restart

Step 2: Find WSL IP Address

In WSL, run:

hostname -I

Note the IP address (typically starts with 172.).

Step 3: Configure Windows Firewall

1. Open Windows Defender Firewall with Advanced Security

  • Press Win + R, type wf.msc, and hit Enter.

  • Alternatively, search for "Windows Defender Firewall with Advanced Security" in the Start menu.

2. Create a New Inbound Rule

  1. In the left panel, click "Inbound Rules".

  2. In the right panel, click "New Rule...".

  3. Select "Port" and click Next.

  4. Choose "TCP" and enter the SSH port (default: 22).

    • If you changed the port in sshd_config, use that instead.

  5. Click Next.

3. Allow the Connection

  • Select "Allow the connection" (recommended for local networks).

    • If security is a concern, choose "Allow the connection if it is secure" (requires IPsec).

  • Click Next.

4. Select When the Rule Applies

  • Check all three options:

    • Domain (if applicable)

    • Private (for home/work networks)

    • Public (if you want to allow external connections, not recommended unless necessary)

  • Click Next.

5. Name the Rule

  • Give it a descriptive name (e.g., "WSL SSH Access (Port 22)").

  • Optionally, add a description.

  • Click Finish.

Step 4: Connect remote WSL with Terminal on GASVIEW

  1. Open Terminal

  1. Enter connection details:

  • Host Name: [WSL_IP] (from Step 2)

  • Port: 22

  • Connection type: SSH

  1. Click "Open"

  2. Log in with your WSL username and password

Step 5: Connect remote WSL with FTP on GASVIEW

  1. Open FTP

  2. Enter connection details:

    • Host Name: [WSL_IP] (from Step 2)

    • Port: 22

    • Connection type: SSH

  3. Click "Open"

  4. Log in with your WSL username and password

Troubleshooting

  1. Connection Refused

    • Verify SSH is running in WSL: sudo service ssh status

    • Check firewall settings

  2. Changing IP Address WSL IP may change on reboot. To find current IP:

    hostname -I

Notes

  • For regular local WSL access, simply using wsl command is easier than

  • SSH is useful for remote access or port forwarding scenarios

  • Consider using SSH keys instead of password authentication for better security

Last updated

Was this helpful?