On Tue, 28 Mar 2000, Benjamin Scherrey wrote:
> A couple of questions for you sysadmin types out there...
>
> 1. If I'm root on my box and I want to watch what other users are
> doing on my system, is there any standard way to view what's going on
> in other people's terminals? Is there a way for me to send my screen
Someone else will have to comment on how to actually snoop on
actual tty's (I find that a bit too much), but, usually looking at the
user's "~user/.bashrc" file will yield enough information (granted that
your users are using the bash shell).
> output (realtime) to another user to see? I'd like to do this with
> more command line and X term sessions.
Ask your user to type "tty". They'll get something back which is
to the tune of "/dev/pts/2". Then, as root, do a "script /dev/pts/2". This
will make it s.t all of your input and output will show up on the other
user's terminal. Note though, that you aren't "taking control" of their
terminal, only displaying your session onto it. Once you are done
displaying to the remote terminal, "exit" will stop the "script".
>
> 2. I'm running RedHat 6.1 on i686. Where do I specify xhost
> accessibility in my configuration? Every time I try to remote login to
This depends on whether or not you're using "xdm" or not. If
you're using "xdm" then chances are, youre logging in via some sort of
XWindows login prompt. If you get into X via xinit, then chances are you
log in to a text prompt, then type "startx".
In the case of xdm logins, perhaps the least painful way to do
things is to add the "xhost" commands to your window manager "startup"
options. For instance, KDE has a "Startup" folder (or something like that)
where, any .kdelnk in that folder is started up when KDE fires up. Just
create a .kdelnk for each "xhost". Gnome has a similar functionality
though, IMHO is a bit more cryptic to get new stuff into it's startup.
The other option would be to create a file called ".xsession" in
your home directory. This file would look something like:
-------------------
#!/bin/sh
xhost +foo &
xhost +bar &
startkde
--------------------
The (dis)advantage of .xsession files is that .xsession files
always override the window manager options which you chose during your xdm
login.
If you get into X via "startx", then create a file called
".xinitrc" with the above script inside. When you type startx, a program
called "xinit" looks for your .xinitrc, if it doesn't find it, then the
"system wide" xinitrc is used (which I think is under
/usr/lib/X11/xinit/xinitrc). So, if you like the "default" setup, then
copy the system xinitrc into your home directory as ".xinitrc" and add the
appropriate xhost lines.
IMHO, the best way to do remote X execution is via ssh. Instead of
telnetting into the remote machines, just "ssh" into them. Granted that
you get a secure connection in, you should (most of the time) just be able
to start running X apps and have them show up on your box. SSH takes care
of the "xhost" and "display" stuff for you, as well as being much more
secure than the "xhost" option. If you're really into self abuse, you may
want to try using "xauth", but, with ssh now, it's not worth the effort.
If you like the ssh route, then my next suggestion would be to
take a look at "ssh-agent" and "ssh-add". These allow for you to only have
to type your password in once in order to log into and even execute X apps
from remote machines.
- Mike
====================================================================
Michael Kachline CS, Georgia Institute of Technlology
">kachline@brightstar.gt.ed.net
http://brightstar.gt.ed.net/kachline
====================================================================
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.