<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ssh sets up environment variables differently in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983390#M420323</link>
    <description>Mel,&lt;BR /&gt;&lt;BR /&gt;See man sshd under "Login Process".  The basic environment it sets up is determined at compile time, then it sets up what is in $HOME/.ssh/environment.  The last step is "Runs user's shell OR command".&lt;BR /&gt;&lt;BR /&gt;-Paul</description>
    <pubDate>Tue, 06 Jun 2006 17:25:36 GMT</pubDate>
    <dc:creator>Paul F. Carlson</dc:creator>
    <dc:date>2006-06-06T17:25:36Z</dc:date>
    <item>
      <title>ssh sets up environment variables differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983384#M420317</link>
      <description>I know the subject is a little vague but here is the explanation:&lt;BR /&gt;&lt;BR /&gt;ssh oracle@host lsnrctl stop&lt;BR /&gt;&lt;BR /&gt;ksh: lsnrctl:  not found&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ssh oracle@host&lt;BR /&gt;&lt;BR /&gt;host# lsnrctl stop&lt;BR /&gt;&lt;BR /&gt;LSNRCTL for HPUX: Version 9.2.0.7.0 - Production on 06-JUN-2006 14:23:53&lt;BR /&gt;&lt;BR /&gt;Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.&lt;BR /&gt;&lt;BR /&gt;Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=BWD.WORLD))&lt;BR /&gt;The command completed successfully&lt;BR /&gt;&lt;BR /&gt;ssh oracle@host "env | grep PATH"&lt;BR /&gt;PATH=/usr/bin:/bin:/usr/sbin:/sbin:/opt/ssh/bin&lt;BR /&gt;&lt;BR /&gt;ssh oracle@host &lt;BR /&gt;&lt;BR /&gt;host# env | grep PATH&lt;BR /&gt;PATH=/oracle/SID/920_64/bin:/usr/sap/SID/SYS/exe/run:/usr/bin:/usr/ccs/bin:/usr/local/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/pd/bin:/opt/resmon/bin:/opt/gnome/bin:/opt/perf/bin:/opt/ignite/bin:/opt/mozilla:/usr/bin/X11:/usr/contrib/bin/X11:/opt/graphics/common/bin:/opt/prm/bin:/usr/sbin/diag/contrib:/opt/mx/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/hpnpl//bin:&lt;BR /&gt;&lt;BR /&gt;why are they different and what variable in which configuration file controls this difference.&lt;BR /&gt;&lt;BR /&gt;Thanks for all the responses in advance&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Jun 2006 16:30:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983384#M420317</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2006-06-06T16:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: ssh sets up environment variables differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983385#M420318</link>
      <description>Mel, I would think that what's happening is that when you invoke a full shell, then your .profile and .kshrc  (or .cshrc) is being read, and then you can type your commands.  When you're ssh'ing over to  another computer and giving commands, I'm thinking that one or both of the two files mentioned above is not being read.&lt;BR /&gt;&lt;BR /&gt;Instead make a command file to do the shutdown, and put the environment variables in the command script file.&lt;BR /&gt;&lt;BR /&gt;E.g.&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;# listener shutdown for MYDB&lt;BR /&gt;#&lt;BR /&gt;ORACLE_HOME=/u1/oracle/MYDB/9.2.0&lt;BR /&gt;TNS_ADMIN=${ORACLE_HOME}/network/admin&lt;BR /&gt;PATH=${PATH}:${ORACLE_HOME}/bin&lt;BR /&gt;export ORACLE_HOME TNS_ADMIN&lt;BR /&gt;&lt;BR /&gt;lsnrctl stop&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Jun 2006 16:40:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983385#M420318</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2006-06-06T16:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: ssh sets up environment variables differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983386#M420319</link>
      <description>You could add your enviromental variables to ~/.ssh/environment for your oracle user.  Then in sshd_config set PermitUserEnvironment yes and restart sshd.&lt;BR /&gt;&lt;BR /&gt;See man sshd_config and man ssh.&lt;BR /&gt;&lt;BR /&gt;-Paul</description>
      <pubDate>Tue, 06 Jun 2006 16:56:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983386#M420319</guid>
      <dc:creator>Paul F. Carlson</dc:creator>
      <dc:date>2006-06-06T16:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: ssh sets up environment variables differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983387#M420320</link>
      <description>Note:  That should be ~oracle/.ssh/environment</description>
      <pubDate>Tue, 06 Jun 2006 17:01:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983387#M420320</guid>
      <dc:creator>Paul F. Carlson</dc:creator>
      <dc:date>2006-06-06T17:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: ssh sets up environment variables differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983388#M420321</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;Thanks for the suggestion but the remote account as you can guess belongs to the dba's and I do not want to make any changes as they can break something and I do not like to be at the target end of a pointing finger. &lt;BR /&gt;&lt;BR /&gt;Paul,&lt;BR /&gt;&lt;BR /&gt;Due to pretty much the same thing above, I do not want to mess with their account settings. &lt;BR /&gt;&lt;BR /&gt;All in all, I want the ssh session having the same environments regarless I am in an iteractive session or remote command execution mode. Can this be accomplished without creating new files or changing the environment variables related to oracle ?</description>
      <pubDate>Tue, 06 Jun 2006 17:14:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983388#M420321</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2006-06-06T17:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: ssh sets up environment variables differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983389#M420322</link>
      <description>An interactive shell prompt is a very different environment than running a remote command -- you're not starting a login shell so two very important files are skipped: /etc/profile and ,profile (and if they use a different shell, other profile files). So to set the same environment, you need to source the same profiles that an interactive login sources. So your remote command will need several commands on the same line, something like:&lt;BR /&gt; &lt;BR /&gt;ssh &lt;REMOTE_COMPUTER_STUFF&gt; '. /etc/profile;. $HOME/.profile; remote_command parms'&lt;BR /&gt; &lt;BR /&gt;The single quotes pass everything over to the remote system and the multiple commands will emulate a login shell environment.&lt;/REMOTE_COMPUTER_STUFF&gt;</description>
      <pubDate>Tue, 06 Jun 2006 17:22:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983389#M420322</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-06-06T17:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: ssh sets up environment variables differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983390#M420323</link>
      <description>Mel,&lt;BR /&gt;&lt;BR /&gt;See man sshd under "Login Process".  The basic environment it sets up is determined at compile time, then it sets up what is in $HOME/.ssh/environment.  The last step is "Runs user's shell OR command".&lt;BR /&gt;&lt;BR /&gt;-Paul</description>
      <pubDate>Tue, 06 Jun 2006 17:25:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983390#M420323</guid>
      <dc:creator>Paul F. Carlson</dc:creator>
      <dc:date>2006-06-06T17:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: ssh sets up environment variables differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983391#M420324</link>
      <description>Bill is Guru!! Thank you!&lt;BR /&gt;&lt;BR /&gt;After spend 3 hours, finally got your post.&lt;BR /&gt;&lt;BR /&gt;Now my command works like&lt;BR /&gt;&lt;BR /&gt;ssh -q -o 'StrictHostKeyChecking no' -o 'BatchMode yes' oracle@$v -i /home/oracle/.ssh/open-key '. /etc/profile;. /home/oracle/.profile;sqlplus -V' &amp;gt;&amp;gt; $LOGFILE&lt;BR /&gt;&lt;BR /&gt;Hahahahaha! Excellent! Thank you Bill!</description>
      <pubDate>Wed, 31 Jan 2007 04:55:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983391#M420324</guid>
      <dc:creator>FrankZhou</dc:creator>
      <dc:date>2007-01-31T04:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: ssh sets up environment variables differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983392#M420325</link>
      <description>thread closed</description>
      <pubDate>Tue, 24 Apr 2007 09:13:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-sets-up-environment-variables-differently/m-p/4983392#M420325</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2007-04-24T09:13:54Z</dc:date>
    </item>
  </channel>
</rss>

