This is the mail archive of the cygwin mailing list for the Cygwin 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: problem with starting programs via ssh / cannot see environment variable


Ok, second attempt (sorry, I'm new to this mailing list)

1) cygcheck.out is attached

2) What I want to do:
I have a linux (server) and a windows (client) machine. I want to connect from the server to the client via ssh and start a program there. The problem is, that the program fails to start.

- when I launch the program directly on the client out of a cygwin shell it runs perfect. The 'export' command shows all the required environment variables, e.g. ANSYS90.... These variables are defined in the global environment.
$ export
declare -x ALLUSERSPROFILE="C:\\Documents and Settings\\All Users"
declare -x ANSYS81_DIR="C:\\Program Files\\Ansys Inc\\v81\\ANSYS"
declare -x ANSYS90_DIR="C:\\Program Files\\Ansys Inc\\v90\\ANSYS"
declare -x ANSYSLIC_DIR="C:\\Program Files\\Ansys Inc\\Shared Files\\Licensing"
declare -x ANSYS_SYSDIR="Intel"
declare -x BOOKSHELF="C:\\IFOR\\WIN\\BIN\\EN_US"
declare -x CADOE_DOCDIR81="C:\\Program Files\\Ansys Inc\\v81\\CommonFiles\\help\\en-us\\solviewer"
declare -x CADOE_DOCDIR90="C:\\Program Files\\Ansys Inc\\v90\\CommonFiles\\help\\en-us\\solviewer"
declare -x CADOE_LIBDIR81="C:\\Program Files\\ANSYS Inc\\v81\\CommonFiles\\Language\\en-us"
declare -x CADOE_LIBDIR90="C:\\Program Files\\ANSYS Inc\\v90\\CommonFiles\\Language\\en-us"
declare -x COMMONPROGRAMFILES="C:\\Program Files\\Common Files"
declare -x COMPUTERNAME="client"
declare -x COMSPEC="C:\\WINDOWS\\system32\\cmd.exe"
declare -x CVS_RSH="/bin/ssh"
declare -x CYGWIN="ntsec"
declare -x FP_NO_HOST_CHECK="NO"
declare -x HELP="C:\\IFOR\\WIN\\BIN"
declare -x HOME="/home/mgiger"
declare -x HOMEDRIVE="C:"d
eclare -x HOMEPATH="\\cygwin\\home\\mgiger"
declare -x HOSTNAME="client"
declare -x I4_INSTALL_DRIVE="C:"
declare -x I4_LANG="EN_US"
declare -x INCLUDE="C:\\Program Files\\Intel\\MKL72\\include"
declare -x INFOPATH="/usr/local/info:/usr/info:/usr/share/info:/usr/autotool/devel/info:/usr/autotool/stable/info:"
declare -x INTEL_LICENSE_FILE="C:\\Program Files\\Common Files\\Intel\\Licenses"
declare -x IPF_PATH32="C:\\IFOR\\WIN\\BIN\\EN_US"
declare -x KMP_STACKSIZE="4m"
declare -x LIB="C:\\Program Files\\Intel\\MKL72\\ia32\\lib"
declare -x LOGNAME="mgiger"
declare -x LOGONSERVER="\\\\CRACK"
declare -x MAIL="/var/spool/mail/mgiger"
declare -x MAKE_MODE="unix"
declare -x MANPATH="/usr/local/man:/usr/man:/usr/share/man:/usr/autotool/devel/man::/usr/ssl/man"
declare -x NLSPATH="C:\\IFOR\\LS\\MSG\\%L\\%N"
declare -x NUMBER_OF_PROCESSORS="2"
declare -x OLDPWD="/home/mgiger"
declare -x OS="Windows_NT"
declare -x PATH="/usr/lib/subversion/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/c/Program Files/Intel/MKL72/ia32/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/Program Files/OpenAFS/Client/Program:/c/Program Files/OpenAFS/Common:/c/Program Files/UltraEdit:/c/IFOR/WIN/BIN:/c/IFOR/WIN/BIN/EN_US:/bin"
declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH"
declare -x PKG_CONFIG_PATH="/usr/X11R6/lib/pkgconfig"
declare -x PRINTER="Adobe PDF"
declare -x PROCESSOR_ARCHITECTURE="x86"
declare -x PROCESSOR_IDENTIFIER="x86 Family 15 Model 2 Stepping 9, GenuineIntel"
declare -x PROCESSOR_LEVEL="15"
declare -x PROCESSOR_REVISION="0209"
declare -x PROGRAMFILES="C:\\Program Files"
declare -x PS1="\\[\\033]0;\\w\\007\
\\033[32m\\]\\u@\\h \\[\\033[33m\\w\\033[0m\\]\
\$ "
declare -x PVM_ARCH="win32"
declare -x PVM_ROOT="/usr/lib/pvm3"
declare -x PVM_ROOT_U="/usr/lib/pvm3"
declare -x PVM_RSH="/bin/ssh"
declare -x PVM_TMP="/tmp"
declare -x PWD="/home/mgiger"
declare -x P_SCHEMA="C:\\Program Files\\Ansys Inc\\v90\\ANSYS\\ac4\\schema"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_CLIENT="129.132.167.199 34058 22"
declare -x SSH_CONNECTION="129.132.167.199 34058 129.132.168.175 22"
declare -x SSH_TTY="/dev/tty1"
declare -x SYSTEMDRIVE="C:"
declare -x SYSTEMROOT="C:\\WINDOWS"
declare -x TEMP="/tmp"
declare -x TERM="xterm"
declare -x TMP="/tmp"
declare -x TZ="WEST-1WEST-2,M3.5.0/2,M10.5.0/3"
declare -x USER="mgiger"
declare -x USERDOMAIN="D"
declare -x USERNAME="mgiger"
declare -x WINDIR="C:\\WINDOWS"

so far, so good.

- when I connect from the server to the host via ssh the program cannot be started due to missing environment variables. The command 'ssh client "export"' does not provide the required environment variables. 

ssh client "export"
mgiger@client's password:
declare -x ALLUSERSPROFILE="C:\\Documents and Settings\\All Users"
declare -x COMMONPROGRAMFILES="C:\\Program Files\\Common Files"
declare -x COMPUTERNAME="client"
declare -x COMSPEC="C:\\WINDOWS\\system32\\cmd.exe"
declare -x CYGWIN="ntsec"
declare -x HOME="/home/mgiger"
declare -x HOMEDRIVE="C:"
declare -x HOMEPATH="\\cygwin\\home\\mgiger"
declare -x LOGNAME="mgiger"
declare -x LOGONSERVER="\\\\CRACK"
declare -x MAIL="/var/spool/mail/mgiger"
declare -x NUMBER_OF_PROCESSORS="2"
declare -x OLDPWD
declare -x OS="Windows_NT"
declare -x PATH="/usr/bin:/c/Program Files/Intel/MKL72/ia32/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/Program Files/OpenAFS/Client/Program:/c/Program Files/OpenAFS/Common:/c/IFOR/WIN/BIN:/c/IFOR/WIN/BIN/EN_US:/bin"
declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH"
declare -x PROCESSOR_ARCHITECTURE="x86"
declare -x PROCESSOR_IDENTIFIER="x86 Family 15 Model 2 Stepping 9, GenuineIntel"
declare -x PROCESSOR_LEVEL="15"
declare -x PROCESSOR_REVISION="0209"
declare -x PROGRAMFILES="C:\\Program Files"
declare -x PWD="/home/mgiger"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_CLIENT="129.132.167.199 34057 22"
declare -x SSH_CONNECTION="129.132.167.199 34057 129.132.168.174 22"
declare -x SYSTEMDRIVE="C:"
declare -x SYSTEMROOT="C:\\WINDOWS"
declare -x TEMP="/tmp"
declare -x TMP="/tmp"
declare -x USER="mgiger"
declare -x USERDOMAIN="D"
declare -x USERNAME="mgiger"
declare -x USERPROFILE="C:\\Documents and Settings\\mgiger"
declare -x WINDIR="C:\\WINDOWS"

after manually adding the required environment variables using the 'export' command in the actual shell, the program can be run via ssh. 

I could add these environment variables manually in a .bashrc file and then everything would work fine, but this is not really the way to go (copying environment variables).

3) login in via ssh from server to client and vice versa works perfectly (browsing, copying files, etc)

4) I use password authentication, not pubkey authentication

Question: What has to be done to make all environment variables visible to the ssh connection?

I hope someone has a clue.
Mathias


-----Original Message-----
From: Larry Hall [mailto:lh-no-personal-replies-please@cygwin.com]
Sent: Wed 7/27/2005 4:23 PM
To: Giger  Mathias; cygwin@cygwin.com
Subject: Re: problem with starting programs via ssh / cannot see  environment variable
 
At 09:50 AM 7/27/2005, you wrote:

>Hi all,
>
>I have a problem with starting programs via ssh. when logging in on to a xp host with cygwin everything works fine.
>(browsing files etc.)
>
>When I want to start a program requiring some environment variables from xp I run into troubles. The job is started
>in the task manager, but the program cannot be run due to missing environment variables.
>
>These are some e.v. that are shown:
>$ export
>declare -x ALLUSERSPROFILE="C:\\Documents and Settings\\All Users"
>declare -x COMMONPROGRAMFILES="C:\\Program Files\\Common Files"
>declare -x COMPUTERNAME="ORANGE26"
>declare -x COMSPEC="C:\\WINDOWS\\system32\\cmd.exe"
>declare -x CVS_RSH="/bin/ssh"
>.
>.
>.
>declare -x WINDIR="C:\\WINDOWS"
>
>this is only a subset of all e.v. from xp (system -> environment variables)
>
>for running e.g. ANSYS (a simulation program) some more e.v. are required which are properly defined in xp,
>but cannot be seen via ssh. the correct list would have to look like:
>
>$ export
>declare -x ALLUSERSPROFILE="C:\\Documents and Settings\\All Users"
>declare -x ANSYS81_DIR="C:\\Program Files\\Ansys Inc\\v81\\ANSYS"
>declare -x ANSYS90_DIR="C:\\Program Files\\Ansys Inc\\v90\\ANSYS"
>declare -x ANSYSLIC_DIR="C:\\Program Files\\Ansys Inc\\Shared Files\\Licensing"
>declare -x ANSYS_SYSDIR="Intel"
>declare -x BOOKSHELF="C:\\IFOR\\WIN\\BIN\\EN_US"
>...etc
>
>I can add this environment variables manually in a .bashrc file and then everything works fine, but this is not really the way
>to go. (Copying environment variables is a rather ugly "hack")
>
>Anyone an idea?


Yes, please read and follow all the suggested problem reporting guidelines 
outlined here:

>Problem reports:       http://cygwin.com/problems.html


In the absence of this information, all folks on the list can do is guess
what your environment is and what you're doing.  In that vein, my WAG is
that you're using pubkey authentication and these variables are not in the
global environment.  If that's true, then the two options you have are 
using password authentication or adding the variables you want to the 
global environment.




--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     



Attachment: cygcheck.out
Description: cygcheck.out

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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