<?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>article Set Local variables in PSMP session in PAM Self-Hosted Articles</title>
    <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-articles/set-local-variables-in-psmp-session/ta-p/1429683</link>
    <description>&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Sometimes it is necessary to define an environment variable when starting a PSMP session.&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;H3&gt;Steps&lt;/H3&gt;
&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Below are two possible methods to do this:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;
&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Specify the environment variable in the ClientApp parameter of the PSMP-SSH Connection Component.&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;OL style="list-style-type: lower-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;On the target machine add the following line to the sshd.config: AcceptEnv &amp;lt;ENV_VARIABLE&amp;gt;, where &amp;lt;ENV_VARIABLE&amp;gt; is the name of the environment variable. Make sure to restart the sshd service (service sshd restart).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;In PVWA got to Administration &amp;gt; options &amp;gt; Connection Components &amp;gt; PSMP-SSH &amp;gt; Target Settings &amp;gt; ClientApp&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Add the environment variable to the ClientApp value using -o SetEnv for example:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;{PSPComponentsFolder}/ssh [-{PSMProtocol}] [-p {Port}] -o "SetEnv TEST_ONE=test1" [-L {PSMTunnelRandomPort}:127.0.0.1:{PSMTunnelTargetPort}] {Username}@{Address}&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;OL&gt;&lt;LI style="list-style-type: none;"&gt;
&lt;OL start="4" style="list-style-type: lower-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Save the changes and either restart the PSMP service or wait for the configuration update (usually 10 minutes).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;BR /&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;NOTES :&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;UL&gt;&lt;LI style="margin-left: 8px;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;This only works with the ssh client in PSMP. It will not work with the plink client.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin-left: 8px;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;The change to the ClientApp parameter can be done as an override of the Target Settings for a specific platform.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin-left: 8px;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;To make this dynamic per account it is possible to add a parameter to the ClientApp value instead of a hard-codded value for the environment variable. For example add a parameter to the platform called EnvValue and change the ClientApp value to:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;{PSPComponentsFolder}/ssh [-{PSMProtocol}] [-p {Port}] -o "SetEnv TEST_ONE={ EnvValue}" [-L {PSMTunnelRandomPort}:127.0.0.1:{PSMTunnelTargetPort}] {Username}@{Address}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;
&lt;OL start="2"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Open the PSMP connection as a shell command in a terminal using -t and export. For example:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;ssh -t VaultUser@TargetUser@TargetAddress@PSMPaddress 'export TEST_ONE=test1; bash'&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV style="margin-left: 40px;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;On the target&amp;nbsp;machine make sure to add the following line to the sshd.config: AcceptEnv TEST_ONE. Make sure to restart the sshd service (service sshd restart).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;&amp;nbsp;</description>
    <pubDate>Sun, 09 Jan 2022 13:35:51 GMT</pubDate>
    <dc:creator>CyberArkAlumni</dc:creator>
    <dc:date>2022-01-09T13:35:51Z</dc:date>
    <item>
      <title>Set Local variables in PSMP session</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-articles/set-local-variables-in-psmp-session/ta-p/1429683</link>
      <description>&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Sometimes it is necessary to define an environment variable when starting a PSMP session.&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;H3&gt;Steps&lt;/H3&gt;
&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Below are two possible methods to do this:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;
&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Specify the environment variable in the ClientApp parameter of the PSMP-SSH Connection Component.&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;OL style="list-style-type: lower-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;On the target machine add the following line to the sshd.config: AcceptEnv &amp;lt;ENV_VARIABLE&amp;gt;, where &amp;lt;ENV_VARIABLE&amp;gt; is the name of the environment variable. Make sure to restart the sshd service (service sshd restart).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;In PVWA got to Administration &amp;gt; options &amp;gt; Connection Components &amp;gt; PSMP-SSH &amp;gt; Target Settings &amp;gt; ClientApp&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Add the environment variable to the ClientApp value using -o SetEnv for example:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;{PSPComponentsFolder}/ssh [-{PSMProtocol}] [-p {Port}] -o "SetEnv TEST_ONE=test1" [-L {PSMTunnelRandomPort}:127.0.0.1:{PSMTunnelTargetPort}] {Username}@{Address}&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;OL&gt;&lt;LI style="list-style-type: none;"&gt;
&lt;OL start="4" style="list-style-type: lower-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Save the changes and either restart the PSMP service or wait for the configuration update (usually 10 minutes).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;BR /&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;NOTES :&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;UL&gt;&lt;LI style="margin-left: 8px;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;This only works with the ssh client in PSMP. It will not work with the plink client.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin-left: 8px;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;The change to the ClientApp parameter can be done as an override of the Target Settings for a specific platform.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin-left: 8px;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;To make this dynamic per account it is possible to add a parameter to the ClientApp value instead of a hard-codded value for the environment variable. For example add a parameter to the platform called EnvValue and change the ClientApp value to:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;{PSPComponentsFolder}/ssh [-{PSMProtocol}] [-p {Port}] -o "SetEnv TEST_ONE={ EnvValue}" [-L {PSMTunnelRandomPort}:127.0.0.1:{PSMTunnelTargetPort}] {Username}@{Address}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;
&lt;OL start="2"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Open the PSMP connection as a shell command in a terminal using -t and export. For example:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;ssh -t VaultUser@TargetUser@TargetAddress@PSMPaddress 'export TEST_ONE=test1; bash'&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV style="margin-left: 40px;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;On the target&amp;nbsp;machine make sure to add the following line to the sshd.config: AcceptEnv TEST_ONE. Make sure to restart the sshd service (service sshd restart).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;&amp;nbsp;</description>
      <pubDate>Sun, 09 Jan 2022 13:35:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-articles/set-local-variables-in-psmp-session/ta-p/1429683</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2022-01-09T13:35:51Z</dc:date>
    </item>
  </channel>
</rss>

