LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   X11 forwarding problem over ssh. Where DISPLAY is set? (http://www.linuxquestions.org/questions/linux-software-2/x11-forwarding-problem-over-ssh-where-display-is-set-757897/)

kaz2100 09-26-2009 06:57 AM

X11 forwarding problem over ssh. Where DISPLAY is set?
 
Hya,

I have four Debian penguins, (3 squeeze, 1 etch).

One of them does not forward X11 to other over ssh. (saying that DISPLAY is not set) This one can be forwarded by other.

ssh_config and sshd_config say that X11forwarding is yes.

ssh -vvv user@non.behaving.penguin indicates that DISPLAY is not set.

At this moment, I am trying to figure out which program (daemon, script or whatever) sets DISPLAY.

So far, I have reinstalled openssh-server, ssh using aptitude.

Does anybody know how to proceed?

Any suggestions will be appreciated.

Happy Penguins!

Elv13 09-26-2009 03:13 PM

Append the before your command:

DISPLAY=:0 <yourcomamnd>

If it does not work, then it is because the feature is disabled, like in Ubuntu. It is not hard to enable again, but I don't remember how I did it.

rjlee 09-26-2009 04:20 PM

kaz2100, it's sshd (server-side, ie the machine you connect into) that actually sets the DISPLAY variable. It allocates a fake X server on the server, and forwards connections through ssh (client-side, the machine you connect from). ssh then looks up its own DISPLAY variable to work out where to send connections to (so ssh must be run from a GUI terminal, or otherwise with DISPLAY set).

There's also some magic with xauth for authentication.

http://csociety.ecn.purdue.edu/~sigo...rding/#X11-how

kaz2100 09-27-2009 05:32 AM

Hya,

Thanks, Elv13 and rjlee.

Setting DISPLAY suggested by Elv13 did not work. I tried many different possibilities (:0, localhost:10.0 ....)

Then as suggested by rjlee, I just followed how sshd works. I was not quite sure if it was behaving right. For some reason, I tried to ssh to same machine (on non-behaving penguin), which did not work. (again, ssh -vvv was not helpful)

Just hoping something is wrong with network connection, I went to weed out everything out of dmesg and /var/log/whatever/files. Then I found that udev renamed wlan0 to ath0, even no madwifi was used any more. (My memory says that the node ath0 is made by wlanconfig, which is included in madwifi.) Next thing I did was to remove /etc/udev/rules.d/70-persistent-net.rules (content follows.)
Code:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# MAC addresses must be written in lowercase.

SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:16:e3:00:01:01", ATTR{type}=="1", NAME="ath0"

SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:16:d4:22:11:22", NAME="eth0"

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:a0:d1:22:11:22", NAME="eth1"

# PCI device 0x168c:0x001a (ath_pci)
SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:16:e3:00:01:02", ATTR{type}=="1", NAME="ath1"

Then reinstall udev again by aptitude, followed by reboot. BINGO! Healthy Penguin!!

For information, working udev rule looks like:
Code:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:16:d4:22:11:22", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x168c:0x001c (ath5k)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:16:e3:00:01:01", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

I am not sure what happened behind this at all, but it is working now.

Happy Penguins!


All times are GMT -5. The time now is 12:01 PM.