Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Apr 1996 18:40:46 -0500 (EST)
From:      John Fieber <jfieber@indiana.edu>
To:        Khetan Gajjar <khetan@iafrica.com>
Cc:        questions@freebsd.org
Subject:   Re: xhost
Message-ID:  <Pine.NEB.3.93.960420182316.435H-100000@Fieber-John.campusview.indiana.edu>
In-Reply-To: <Pine.BSF.3.91.960421004940.239B-100000@localhost.iafrica.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 21 Apr 1996, Khetan Gajjar wrote:

> Everytime I run xdm, I then have to login as root, xhost + and
> then restart xdm.

I'm not exactly sure I follow...

> Anyway I can get xhost to retain it's settings permanently (i.e. xhost + 
> - all clients)  ? It doens't seem to retain settings.....

You put whatever xhost command you want to execute in your
$HOME/.xsession file.  However, using xhost is a Bad Thing in terms
of security since it allows *anyone* on the remote system unrestricted
access to your display and keyboard.  

A better way is using xauth.  When you log in via xdm, it creates an
entry in your $HOME/.Xauthority file that contains a session key that
clients must present to be allowed to connect.  For remote hosts, you
have to transfer that information from your local .Xauthority file to
the remote one.  I use the script below start up an xterm on another
host. It certainly isn't perfect security, but its much better than
xhost. See the xauth man page for more information.

  #!/bin/sh
  host=`basename $0`
  xauth extract - `hostname`:0 | rsh $host xauth merge -
  xon $host xterm -n $host -T $host -ls

It gets the name of the remote host from the name of the script, i.e.
if the script was named `copper', the host would be copper.  You can
just make one script and use links or copy it for other hosts.

-john

== jfieber@indiana.edu ===========================================
== http://fallout.campusview.indiana.edu/~jfieber ================




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.93.960420182316.435H-100000>