Re: running X in a telnet session
Andrew Dwight Dixon <firstname.lastname@example.org> writes:
> Hi All, I'm using telnet to log into my desktop machine from my laptop
> and I would like to be able to run an application on the desktop
> machine and have the display be on the laptop. After loging into the
> desktop and switching the DISPLAY variable:
>> export DISPLAY="192.168.1.2:0.0"
> I get this error message when I try to run a program:
> Xlib: connection to "192.168.1.2:0.0" refused by server Xlib: Client
> is not authorized to connect to Server Application initialization
> failed: couldn't connect to display "192.168.1.2:0.0"
> Any ideas?
Your X11 server is set to refuse connections from random machines.
This is the correct thing to do, for without it anyone could connect to
the machine and watch every key you type.
The best way to solve this, as well as to prevent people reading your
password from the network as you telnet in, is to install ssh(1) on the
ssh(1) will happily forward X11 connections for you. Read the ssh(1)
manpage, log in with it, and it should just work(tm).
If you really want to use telnet, though, there are two ways to go about
One is the complicated xauth(1) method, shipping the magic number across
the network to the desktop. If you read the manpage for xauth(1), it has
examples that will let you work it out.
Given that you are using telnet to connect, though, and would be
shipping the xauth key in the clear, I wouldn't bother with that.
The insecure, but simple, way of allowing programs on the desktop
machine to connect is to run the command:
] xhost +desktop.machine.name
This will allow *anyone* on the desktop machine to connect to your X
So, if you choose not to use the ssh(1) thing, *your server is
insecure*. Anyone on the same network can steal your passwork and watch
*every* keystroke (or mouse click) on the X server.
Please, unless you have some pressing reason not to, adopt ssh for this
sort of network connection.
I am constantly amazed when I talk to young people to learn how much
they know about sex and how little about soap.
-- Billie Burke