Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!rex!ames!sheba.arc.nasa.gov!schoch From: schoch@sheba.arc.nasa.gov (Steve Schoch) Newsgroups: comp.windows.x Subject: Re: Authorization questions Message-ID: <1990Dec10.185342.4364@news.arc.nasa.gov> Date: 10 Dec 90 18:53:42 GMT References: <8458@star.cs.vu.nl> Sender: usenet@news.arc.nasa.gov (USENET Administration) Reply-To: schoch@trident.arc.nasa.gov (Steve Schoch) Organization: NASA Ames Research Center, Moffett Field, CA Lines: 54 In article <8458@star.cs.vu.nl>, vdlinden@cs.vu.nl (Frank van der Linden) writes: |> The second one is the one I'm having trouble with. I tried creating a |> .Xauthority file with 'xauth'. The file was indeed created, but it didn't seem |> to work. After 'xauth add my_host:0 . 1234', a 'rsh other_host xterm -display |> my_host:0' still gave a message saying that the server denied permission. There are two problems here: The authorization information (the "MAGIC COOKIE" which in your case is 0x1234) is kept by the server. The server does not generate this cookie but reads it from a file ON STARTUP. If you look closely at the xauth program you will notice that it does not connect to the server but only changes your ".Xauthority" file. |> After this, I tried to start the server with '-auth $HOME/.Xauthority'. It |> had some effect, but too much ... My own clients were also refused connection |> (to 'unix:0.0'). I tried adding this name to the .Xauthority file, but still |> no luck. The result in both cases was an endless loop in my login sequence, |> only stoppable by logging in on the workstation from a terminal and killing |> the server, which in the end left 2 workstations in a weird keyboard-status... Aside: When you kill the server you should give it a SIGTERM (kill ), never a SIGKILL (kill -9 ). When the server gets a SIGTERM it should clean up after itself. I'm a little unclear here about the format of the auth file. On my system, I use xdm which generates both the file used with the "-auth" argument and the ".Xauthority" file in your home directory. The .Xauthority file has the following information: DISPLAY TYPE KEY DISPLAY2 TYPE KEY etc. I'm not sure in what format is the information in the file used by the "-auth" argument. Since your server has two types of connections you want two entries in your .Xauthority file: my_host:0 MIT-MAGIC-COOKIE-1 1234 my_host/unix:0 MIT-MAGIC-COOKIE-1 1234 Then you want to start the server with "-auth $HOME/.Xauthority". Clients connection to unix:0 should now work. To bring up an X window from another host, you should do the following (assuming that DISPLAY is set to my_host:0): xauth extract - $DISPLAY | rsh other_host xauth merge - rsh other_host xterm -display $DISPLAY This will copy the information from your .Xauthority file to the other system. Xterm will look at the file and send the key over. Steve