X11: Forwarding X11

(last edit: 2001-05-22)

Introduction

This doument will explain how to export X11 from one machine to the other with OpenSSH. It is also possible to export X11 without using (Open)SSH but that is a realy insecure way. If your still planning to do this, take a look at 'xhost'. This document furthermore asumes that the server is also running FreeBSD. If it isn't: skip the server side part and find yourself a X-server for your operating system.

Doing things with OpenSSH

Server side: *) Make sure a X server is installed and that it is able to start some graphic programs like e.g. 'xterm' *) Edit the OpenSSH server config file '/etc/ssh/sshd_config' and make sure the following line is enabled: 'X11Forwarding yes'. *) Kill the ssh daemon (MAKE SURE YOU CAN GET IN THE MACHINE VIA SOMETHING LIKE A KEYBOARD) and start it again. You can try a 'killall -HUP sshd' but it didn't always work (on my server). Client side: *) set the environmental variable 'DISPLAY' e.g.: user@host:/#export DISPLAY=[server ip]:0.0 *) Edit the OpenSSH client config file '/etc/ssh/ssh_config' and make sure the following line is enabled: 'ForwardX11 yes'. Let's get to work!!! *) Make a ssh connection to the sever e.g.: user@client:/#ssh user@server *) Start the program e.g.: user@server:/#xterm and xterm should be displayed on the client machine.

Click here to go back to the index.