<?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 env variable different when logon to system vs ssh system &amp;quot;env&amp;quot; in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734376#M386715</link>
    <description>&lt;BR /&gt;I have noticed my env gets setup different depending on how I log into the system. Here is an example to issistrate what I am trying to figureout.&lt;BR /&gt;&lt;BR /&gt;1. &amp;gt;ssh ojrdres1 env (then give passwd)&lt;BR /&gt;• Env listing is very short .. it is not reading my .profile&lt;BR /&gt;2. &amp;gt;ssh ojrdres1 (then give passwd) &lt;BR /&gt;3. &amp;gt;env&lt;BR /&gt;• Env listing is what I expect .. it is reading my .profile.&lt;BR /&gt;&lt;BR /&gt;Do you know how I can perform 1 and get it to read my .profile, and the system .profile?&lt;BR /&gt;</description>
    <pubDate>Wed, 05 Jan 2011 21:38:04 GMT</pubDate>
    <dc:creator>Sammy_2</dc:creator>
    <dc:date>2011-01-05T21:38:04Z</dc:date>
    <item>
      <title>env variable different when logon to system vs ssh system "env"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734376#M386715</link>
      <description>&lt;BR /&gt;I have noticed my env gets setup different depending on how I log into the system. Here is an example to issistrate what I am trying to figureout.&lt;BR /&gt;&lt;BR /&gt;1. &amp;gt;ssh ojrdres1 env (then give passwd)&lt;BR /&gt;• Env listing is very short .. it is not reading my .profile&lt;BR /&gt;2. &amp;gt;ssh ojrdres1 (then give passwd) &lt;BR /&gt;3. &amp;gt;env&lt;BR /&gt;• Env listing is what I expect .. it is reading my .profile.&lt;BR /&gt;&lt;BR /&gt;Do you know how I can perform 1 and get it to read my .profile, and the system .profile?&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Jan 2011 21:38:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734376#M386715</guid>
      <dc:creator>Sammy_2</dc:creator>
      <dc:date>2011-01-05T21:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: env variable different when logon to system vs ssh system "env"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734377#M386716</link>
      <description>Short of recompiling openssh from available source code, I am not sure if you can do this. But again this information is coming from the times ssh was v3.x Now that the version numbers are upto 5 something, there might be some major changes implemented that I am not aware of. &lt;BR /&gt;&lt;BR /&gt;But when you are in remote command execution mode, i.e., your option (1), you will not get your ENVIRONMENT variable like you get during an interactive session. You need to call almost every each command by its absolute path unfortunately.&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Jan 2011 22:50:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734377#M386716</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2011-01-05T22:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: env variable different when logon to system vs ssh system "env"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734378#M386717</link>
      <description>&lt;!--!*#--&gt;With my weak psychic powers, I know&lt;BR /&gt;approximately nothing about _your_ "the&lt;BR /&gt;system", but on mine, "man ssh" says:&lt;BR /&gt;&lt;BR /&gt;[...]&lt;BR /&gt;      If command is specified, it is executed on the remote host instead of&lt;BR /&gt;      a login shell.&lt;BR /&gt;[...]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Do you know how I can perform 1 and get it&lt;BR /&gt;&amp;gt; to read my .profile, and the system&lt;BR /&gt;&amp;gt; .profile?&lt;BR /&gt;&lt;BR /&gt;I wouldn't bet on how many things won't work&lt;BR /&gt;as expected, but you could try something&lt;BR /&gt;like:&lt;BR /&gt;&lt;BR /&gt;      echo env | ssh ojrdres1&lt;BR /&gt;&lt;BR /&gt;That is, no "command" in the ssh command, so&lt;BR /&gt;it will read from stdin.  For example:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;dyi # ssh dyi 'echo $EDITOR'&lt;BR /&gt;&lt;BR /&gt;dyi # &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;dyi # echo 'echo $EDITOR' | ssh dyi 2&amp;gt; /dev/null&lt;BR /&gt;Last successful login:       Wed Jan  5 16:51:22 CST 2011 dyi.antinode.info&lt;BR /&gt;Last authentication failure: Thu Oct 14 12:59:57 CDT 2010 dyi.antinode.info&lt;BR /&gt;You have mail.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Value of TERM has been set to "".&lt;BR /&gt;WARNING:  YOU ARE SUPERUSER !!&lt;BR /&gt;&lt;BR /&gt;vi&lt;BR /&gt;dyi #&lt;BR /&gt;&lt;BR /&gt;Fishing the desired result ("vi") out of the&lt;BR /&gt;log-in noise is only one of the problems with&lt;BR /&gt;a method like this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As usual, some basic information about the&lt;BR /&gt;system(s) involved might be helpful:&lt;BR /&gt;&lt;BR /&gt;      uname -a&lt;BR /&gt;      ssh -V</description>
      <pubDate>Wed, 05 Jan 2011 22:58:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734378#M386717</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-01-05T22:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: env variable different when logon to system vs ssh system "env"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734379#M386718</link>
      <description>Additional information about 2 systems.&lt;BR /&gt;&lt;BR /&gt;SSH From&lt;BR /&gt;=====================&lt;BR /&gt;[root@ojrdlesapp21 ~]# uname -a&lt;BR /&gt;Linux ojrdlesapp21 2.6.18-194.11.1.el5 #1 SMP Tue Jul 27 05:45:06 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux&lt;BR /&gt;&lt;BR /&gt;[root@ojrdlesapp21 ~]# ssh -V&lt;BR /&gt;OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008&lt;BR /&gt;[root@ojrdlesapp21 ~]#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SSH TO&lt;BR /&gt;=========&lt;BR /&gt;&lt;BR /&gt;ojrdhes3::ESDEV:/home/karl030&amp;gt; uname -a&lt;BR /&gt;HP-UX ojrdhes3 B.11.11 U 9000/800 522788742 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;ojrdhes3::ESDEV:/home/karl030&amp;gt; ssh -V&lt;BR /&gt;OpenSSH_3.9, OpenSSL 0.9.7d 17 Mar 2004&lt;BR /&gt;HP-UX Secure Shell-A.03.91.002, HP-UX Secure Shell version&lt;BR /&gt;ojrdhes3::ESDEV:/home/karl030&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 06 Jan 2011 15:05:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734379#M386718</guid>
      <dc:creator>Sammy_2</dc:creator>
      <dc:date>2011-01-06T15:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: env variable different when logon to system vs ssh system "env"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734380#M386719</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;The whole point of the remote command execution is to have a limited shell so you can run commands very quickly.  If you need a specific environment for a specific command, you can set up a wrapper script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;. ./.profile&lt;BR /&gt;${my_command_of_choice}&lt;BR /&gt;#eof&lt;BR /&gt;&lt;BR /&gt;for instance, then call that via :&lt;BR /&gt;&lt;BR /&gt;ssh ${host} ~/bin/my_cmd&lt;BR /&gt;&lt;BR /&gt;lastly, if you really want an environment for your commands, you can update the ~/.ssh/environment file - referenced in the ssh man page:&lt;BR /&gt;&lt;BR /&gt;Additionally, ssh reads ~/.ssh/environment, and adds lines of the format "VARNAME=value" to the environment if the file exists and users are allowed to change their environment.  For more information, see the PermitUserEnvironment option in  sshd_config(5).&lt;BR /&gt;&lt;BR /&gt;HTH;&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Thu, 06 Jan 2011 15:18:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/env-variable-different-when-logon-to-system-vs-ssh-system-quot/m-p/4734380#M386719</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2011-01-06T15:18:21Z</dc:date>
    </item>
  </channel>
</rss>

