Nav

How to X11 forward over SSH using Cygwin

Edit me

Introduction

X11 forwarding over SSH allows access to the GUI of the computer you want to SSH into. It is necessary for running any programs on the remote machine that have graphics.

You will need the following packages for your Cygwin installation:

  • xinit (X11)
  • cygutils-x11 (X11)
  • xterm (X11)

More information about installing Cygwin and its packages can be found here.

Method 1

Navigate to the Cygwin-X folder from the start menu and open the application named “User script”

start_menu

A new cygwin terminal should open up where you can ssh with x11 forwarding.

command

You can now execute ssh commands with x11 forwarding.

Method 2

Navigate to the Cygwin-X folder from the start menu and open the application named “XWin Server”

XWin_Server

Open a cygwin terminal and type the following commands:

export DISPLAY=:0.0
xterm &

A new cygwin terminal should appear where you can ssh with X11 forwarding.

Procedure

X11 forwarding can be used in ssh with the -X or -Y flags. -X is more secure, but -Y will work more often.

More information about the difference between them can be found here or by typing man ssh in your cygwin terminal

Once your new cygwin terminal appears, you can ssh into a computer in the Linux Lab by entering the following command:

ssh -p 5010 h70xxxxxxx@adams204xx.hofstra.edu

The h700 should be your h700 Hofstra number and the xx is a number 01 to 30 (the computer you are trying to SSH into).

You are now remotely logged into a lab computer wth your Linux account and can run graphical programs.

More information about SSHing into lab computers can be found here

See also