[svlug] Best way to monitor for a remote connection?

Rick Schultz bloodyvikings at sbcglobal.net
Tue Aug 6 18:01:22 PDT 2002

On 6 Aug 2002, Jim wrote:

> GOAL: Let the server monitor for a specified remote connection then send
> the tool bar automatically to that system. (rather then logging in to
> fetch it).

I gather the problem is you don't want to start an interactive login in
order to start the toolbar process, right?  Running the process magically
from the server would require that you leave your local X server open to
remote connections, or that you somehow set up the proper xauth
information on the remote machine.

The easiest way to start a remote X process non-interactively is with ssh.
Even if you don't want to set things up such that you can ssh without a
password, you can still run ssh-agent to handle everything.

Try this.  In your .xinitrc, put

  exec ssh-agent sh -c 'ssh-add </dev/null && exec <your windowmanager>'

When you log in, you'll be prompted for your passphrase.  All processes in
that session will have your ssh keys available for remote logins.  Then
you should be able to have 'ssh <hostname> <program>' as launchers on your
local toolbar, and they should run without requiring interactive
authentication.  Alternatively, you could add an 'ssh <server> <toolbar
program>' before you exec your windowmanager to run the toolbar remotely.

Does that help?


 Rick                This space intentionally          bloodyvikings@
 Schultz                   left blank                  sbcglobal.net

More information about the svlug mailing list