Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

X11 forwarding from Debian on Google Compute Engine

I am testing out Google Compute Engine (with an instance running Debian), and I have trouble using X11 forwarding through ssh. To connect to my instance I use

gcloud compute ssh --ssh-flag="-X" instance-name

While connecting I get the following response to the screen

X11 forwarding request failed on channel 0

and X11 forwarding does not work. Is this a problem of proper configuration of shh or perhaps something related to GCE?

I hope someone can help me get X11 forwarding up and running

like image 504
Thomas Mejer Hansen Avatar asked Aug 27 '14 07:08

Thomas Mejer Hansen


People also ask

How do I forward X11 in Linux?

Go to Connection, select SSH, and then click Then, click on Browse to select the private key generated earlier If you are using key based authentication. Go to Connection, select SSH, and then click on Then, select enable X11 forwarding.

What is needed for X11 forwarding?

You first need to make a few minor changes to your Linux machine to enable X11 forwarding. In this example, we'll use a standard CentOS 6.5 installation with GNOME installed. Other Linux distributions will have a very similar SSH daemon configuration. Locate the SSH configuration file at /etc/ssh/sshd_config.

How do I enable IP forwarding in GCP?

Enabling IP forwarding when creating a VM Click Create instance. Expand the Networking, disks, security, management, sole-tenancy section. Expand the Networking section. In the IP forwarding section, select Enable.


1 Answers

I believe that you’re affected by a Debian bug, that prevents you from being able to use X11 forwarding.

Adding AddressFamily inet in /etc/ssh/sshd_config and restarting the SSH server should work.

If it still doesn't work, you could you try to add X11UseLocalhost no in the same file and restart the SSH server again.

like image 78
Adrián Avatar answered Sep 24 '22 05:09

Adrián