xhosts question..

1999-05-04 Thread Allen B. Riddell


Ok, I'm using xdm and everything, when I su to root from my normal account 
and try to use x programs -- the program yells at me and tells me to use 
xhost to add whatever host to the list of approved addresses...


Anyway -- so I get out of the shell and type xhost localhost or something 
like that -- then I su back and everything works fine.


I've read man xhost or xhosts, can't remember which -- but anyway, I 
can't decipher if there is some file that controls access that I could just 
add localhost or whatever to and avoid this whole mess in the first place?


Can someone help?

-abr


Re: xhosts question..

1999-05-04 Thread Michael Stenner
On Mon, 3 May 1999, Allen B. Riddell wrote:

Ok, I'm using xdm and everything, when I su to root from my normal account 
and try to use x programs -- the program yells at me and tells me to use 
xhost to add whatever host to the list of approved addresses...

Anyway -- so I get out of the shell and type xhost localhost or something 
like that -- then I su back and everything works fine.

I've read man xhost or xhosts, can't remember which -- but anyway, I 
can't decipher if there is some file that controls access that I could just 
add localhost or whatever to and avoid this whole mess in the first place?

my understanding is that xhost is NOT the preferred way of handling
this, although if you are not worried about nasty people getting onto
you machine, it is certainly the simplest.

If you are not real security worried, just put xhost +yourhostname
(basically, the command you are already using) in your .xsession (I
think that's the right file) or something.

If you ARE careful about security issues, or you just want to establish
good habits, use the xauth command instead.  It's a little more work,
but it's much more secure.

I use the following command from a script as root:
su mstenner -c 'xauth nextract - :0' | xauth nmerge -

OK... I THINK that's the command I use.  I'm at work at the moment.  In
any event, this command and the xauth manpage should tell you what you
need to get started.   You may need to explicitly tell xauth which files
to use (see the -f option)


The major reason that the latter method is more secure than the former:
it allows only root to access your X session.  xhost +localhost allows
anyone on your machine to run x applications in your session, and to do
some really nasty things (capture keystrokes) and some entertaining
things (move your mouse pointer, change your background...)

You decide :)

-Michael


Re: xhosts question..

1999-05-04 Thread Brant Wells
Howdy Allen:

In your $HOME direcotry, edit the file .xinitrc

In this file somewhere should be a line that says something like:
xhost + blablabla.

If you have no need for security (in a small home network like mine...) you can 
just
add in:

xhost +

and and that should solve the problem.

I think you may have to be root to run xhost.  I'm not sure.

HTH,

Brant W.

Allen B. Riddell wrote:

 Ok, I'm using xdm and everything, when I su to root from my normal account
 and try to use x programs -- the program yells at me and tells me to use
 xhost to add whatever host to the list of approved addresses...

 Anyway -- so I get out of the shell and type xhost localhost or something
 like that -- then I su back and everything works fine.

 I've read man xhost or xhosts, can't remember which -- but anyway, I
 can't decipher if there is some file that controls access that I could just
 add localhost or whatever to and avoid this whole mess in the first place?

 Can someone help?

 -abr

 --
 Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED]  /dev/null


Re: xhosts question..

1999-05-04 Thread Brian Servis
*- On  3 May, Allen B. Riddell wrote about xhosts question..
 
 Ok, I'm using xdm and everything, when I su to root from my normal account 
 and try to use x programs -- the program yells at me and tells me to use 
 xhost to add whatever host to the list of approved addresses...
 
 Anyway -- so I get out of the shell and type xhost localhost or something 
 like that -- then I su back and everything works fine.
 
 I've read man xhost or xhosts, can't remember which -- but anyway, I 
 can't decipher if there is some file that controls access that I could just 
 add localhost or whatever to and avoid this whole mess in the first place?
 
 Can someone help?
 

I use the following method on my single user home machine.  In my root's
.login(I run tcsh as roots shell)

if ($TERM == xterm-debian) then
setenv XAUTHORITY /home/servis/.Xauthority
endif

Where /home/servis is my normal users home directory.  Then all I have
do is set the $DISPLAY variable or supply the -display command line
option for root programs to use X.

-- 
Brian 
-
Mechanical Engineering  [EMAIL PROTECTED]
Purdue University   http://www.ecn.purdue.edu/~servis
-