problems with authorization via `xauth'

Dear all,

I've got problems with X server authentication using `xauth'. The problem is, that I have my local computer running NetBSD 5.1 and a remote computer in LAN which is running Debian GNU Linux. During the login to my NetBSD computer `xdm' generates a magic cookie for my DISPLAY. Then I transfer this cookie via `ssh' to the Debian computer:

xauth extract - "${HOSTNAME}:0"  | ssh debian-comp xauth merge -

After that when making `xauth list', I can see identical magic cookies on both computers. But when I'm trying to start an `xterm' on the Debian computer I only get the following error message:

Invalid XDM-AUTHORIZATION-1 key (failed address comparison)xterm Xt error: Can't open display: sidorenko.xxx.invention.com:0

Could you please make any further suggestions how to solve this problem.

Kind regards,
Vladimir

Not sure if this is going to help, but lets do this manually and see if this works:

After step c), your key should have been added. So try connecting now.

Paste the output from xauth list on your netbsd and debian. Lets take a look.

Also post any errors from Xorg.0.log if any when attempting to connect to remote display.

Hello dude2cool,

Thanks for your suggestion, but unfortunately it seems not to help. I've tried adding the keys manually, but the result stayed the same. Actually the keys were already correctly added with `ssh', so I think that the problem is not with keys but with something else.
Here is the output of `xauth -list' from both machines. For security reasons I've replaced the magic numbers with key1, key2, etc.:
NetBSD Machine (sidorenko):

sidorenko.imb.invention.com:0  MIT-MAGIC-COOKIE-1  key1
sidorenko.imb.invention.com/unix:0  MIT-MAGIC-COOKIE-1  key1
sidorenko.imb.invention.com:0  XDM-AUTHORIZATION-1  key2
sidorenko.imb.invention.com/unix:0  XDM-AUTHORIZATION-1  key2

Debian GNU Linux Machine (syn-proxy7):

syn-proxy/unix:0  MIT-MAGIC-COOKIE-1  key3
syn-proxy.imb.invention.com:0  MIT-MAGIC-COOKIE-1  key3
syn-proxy7/unix:10  MIT-MAGIC-COOKIE-1  key4
sidorenko.imb.invention.com:0  MIT-MAGIC-COOKIE-1  key1
sidorenko.imb.invention.com:0  XDM-AUTHORIZATION-1  key2

Here are the last 15 lines from Xorg.0.log

>tail -15 /var/log/Xorg.0.log
(**) Option "CoreKeyboard"
(**) <default keyboard>: always reports core events
(**) Option "Protocol" "standard"
(**) <default keyboard>: Protocol: standard
(**) Option "AutoRepeat" "500 30"
(**) Option "XkbRules" "xorg"
(**) <default keyboard>: XkbRules: "xorg"
(**) Option "XkbModel" "pc105"
(**) <default keyboard>: XkbModel: "pc105"
(**) Option "XkbLayout" "us"
(**) <default keyboard>: XkbLayout: "us"
(**) Option "CustomKeycodes" "off"
(**) <default keyboard>: CustomKeycodes disabled
(II) XINPUT: Adding extended input device "<default keyboard>" (type: KEYBOARD)
Failed to switch consoles (Device not configured)