This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: scripting using Xterm ssh


I have done something similar with rsh, so I'm going to take a stab at this given what I know about ssh. On the Cygwin system, edit the file .xinitrc in your home directory to look something like this (note that the backslashes "\" indicate a continuation of a single line):

# Set the background to something nice
xsetroot -solid aquamarine

# Launch a local xterm
xterm -title "Local Xterm" &

# Use ssh to launch a remote application in an xterm
# on a remote system
ssh -X -l username_on_remote_host remote_host \
xterm -title "Remote Xterm" \
-e command_you_want_to_run_in_the_remote_xterm &

# Launch window manager
twm

To launch this run the command "xinit" from the Cygwin bash-prompt. It will start up the X server and then execute the contents of the .xinitrc file.

Note that you'll need /usr/X11R6/bin in your path as well. You can accomplish this by adding the following line to the file .bash_profile in your home directory:

export PATH=$PATH:/usr/X11R6/bin

Look at the man page for ssh (using the command "man ssh") for information on how to configure the local and remote systems so that ssh won't prompt for a password.

Good luck.

From: "Dennis Foreman" <dforeman@stny.rr.com>
Reply-To: <dforeman@stny.rr.com>
To: <cygwin-xfree@cygwin.com>
Subject: scripting using Xterm ssh Date: Thu, 18 Jul 2002 11:35:20 -0400

I recently installed Cygwin. I am NOT a highly knowledgeable UNIX user. I
have read the man pages for ssh and Xterm and searched the Xfree archives
using 'ssh' as a search arg.

I am trying to figure out how to create a script that will do ALL of the
following:

1. Use ssh to log me in to my UNIX system, without having to type the
password
2. Create an Xterm window on my Windows desktop
3. Allow the Xterm to be opened without clicking on the X desktop
4. Run a specific program in the Xterm. The program creates Xwindows that
must display on my PC.

I know I can use startxwin.bat to start xterms, but can't figure out how to
make it:
a. send the passwords
b. do it through ssh

I need this as a script because I have to run 7 copies of it (for 7
different systems) before I can actually get my work done.

Can someone give me some places to look for examples or extended
documentation on combining my 4 requirements? Or send me some examples?

regards,
D. J. Foreman
website: http://WWW.CS.Binghamton.EDU/~foreman



_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]