<?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: Python Pexpect and Check Point Gaia Expert Mode in General Topics</title>
    <link>https://community.checkpoint.com/t5/General-Topics/Python-Pexpect-and-Check-Point-Gaia-Expert-Mode/m-p/52342#M10360</link>
    <description>&lt;P&gt;Hi Lisa,&lt;/P&gt;&lt;P&gt;Thank you for raising this query.&lt;/P&gt;&lt;P&gt;Personally, I don't think there is a need for a script here as it's way easier by carrying out the instructions below:&lt;/P&gt;&lt;P&gt;1) Navigate to the firewall's expert mode and type &lt;EM&gt;chsh -s /bin/bash admin&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The above command should put you in expert mode upon the next login.&lt;/P&gt;&lt;P&gt;2) Then, to display the output of certain commands upon login, you will need to edit the .bashrc file inside the /home/admin directory. Once inside the said directory:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;vi .bashrc&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Press Shift + G to go to the bottom of the file followed by '&lt;EM&gt;o&lt;/EM&gt;' to start editing the file.&lt;/P&gt;&lt;P&gt;Next type the commands that you want.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;grep admin /etc/passwd&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;date&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Have a look at this screenshot as well if needed:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Editing the bashrc file.PNG" style="width: 478px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/1048iF03116FE44169F14/image-dimensions/478x348?v=v2" width="478" height="348" role="button" title="Editing the bashrc file.PNG" alt="Editing the bashrc file.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3) Finally, press Escape followed by &lt;EM&gt;:wq&lt;/EM&gt; to save the changes. The end result can be seen below next time you login:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="End Result.PNG" style="width: 374px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/1047i00542BE1C20DA32A/image-size/large?v=v2&amp;amp;px=999" role="button" title="End Result.PNG" alt="End Result.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;4) Repeat the same process on every other firewall.&lt;/P&gt;&lt;P&gt;Since you said that you administer only a few firewalls I believe that would suffice.&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2019 19:46:25 GMT</pubDate>
    <dc:creator>Nick_Doropoulos</dc:creator>
    <dc:date>2019-05-01T19:46:25Z</dc:date>
    <item>
      <title>Python Pexpect and Check Point Gaia Expert Mode</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Python-Pexpect-and-Check-Point-Gaia-Expert-Mode/m-p/52299#M10357</link>
      <description>&lt;P&gt;I administer a few Check Point Firewalls at work that run on the Gaia operating system. Gaia is a hardened, purpose-built Linux OS using the 2.6 kernel.&lt;/P&gt;&lt;P&gt;I am a novice at Python and I need to write a script that will enter "expert mode" from the clish shell. Entering expert mode is similar to invoking su as it gives you root privileges in the BASH shell. Clish is a Cisco like custom shell made to ease OS configuration changes.&lt;/P&gt;&lt;P&gt;I saw a similar discussion at pexpect and ssh: how to format a string of commands after su - root -c, but people responding recommended sudo. This is not an option for me as sudo is not supported by the OS and if you were to install it, clish would not recognize the command.&lt;/P&gt;&lt;P&gt;The goal of my script would be to SSH to the device, login, invoke expert mode, then run grep admin /etc/passwd and date. Again, sudo is not an option.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 09:08:44 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Python-Pexpect-and-Check-Point-Gaia-Expert-Mode/m-p/52299#M10357</guid>
      <dc:creator>Lisa11</dc:creator>
      <dc:date>2019-05-01T09:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python Pexpect and Check Point Gaia Expert Mode</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Python-Pexpect-and-Check-Point-Gaia-Expert-Mode/m-p/52342#M10360</link>
      <description>&lt;P&gt;Hi Lisa,&lt;/P&gt;&lt;P&gt;Thank you for raising this query.&lt;/P&gt;&lt;P&gt;Personally, I don't think there is a need for a script here as it's way easier by carrying out the instructions below:&lt;/P&gt;&lt;P&gt;1) Navigate to the firewall's expert mode and type &lt;EM&gt;chsh -s /bin/bash admin&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The above command should put you in expert mode upon the next login.&lt;/P&gt;&lt;P&gt;2) Then, to display the output of certain commands upon login, you will need to edit the .bashrc file inside the /home/admin directory. Once inside the said directory:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;vi .bashrc&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Press Shift + G to go to the bottom of the file followed by '&lt;EM&gt;o&lt;/EM&gt;' to start editing the file.&lt;/P&gt;&lt;P&gt;Next type the commands that you want.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;grep admin /etc/passwd&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;date&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Have a look at this screenshot as well if needed:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Editing the bashrc file.PNG" style="width: 478px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/1048iF03116FE44169F14/image-dimensions/478x348?v=v2" width="478" height="348" role="button" title="Editing the bashrc file.PNG" alt="Editing the bashrc file.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3) Finally, press Escape followed by &lt;EM&gt;:wq&lt;/EM&gt; to save the changes. The end result can be seen below next time you login:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="End Result.PNG" style="width: 374px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/1047i00542BE1C20DA32A/image-size/large?v=v2&amp;amp;px=999" role="button" title="End Result.PNG" alt="End Result.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;4) Repeat the same process on every other firewall.&lt;/P&gt;&lt;P&gt;Since you said that you administer only a few firewalls I believe that would suffice.&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 19:46:25 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Python-Pexpect-and-Check-Point-Gaia-Expert-Mode/m-p/52342#M10360</guid>
      <dc:creator>Nick_Doropoulos</dc:creator>
      <dc:date>2019-05-01T19:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Python Pexpect and Check Point Gaia Expert Mode</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Python-Pexpect-and-Check-Point-Gaia-Expert-Mode/m-p/52377#M10367</link>
      <description>Note that we do not support the use of expect.&lt;BR /&gt;If it is absolutely required please work with your local office to put in an RFE.</description>
      <pubDate>Thu, 02 May 2019 04:14:57 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Python-Pexpect-and-Check-Point-Gaia-Expert-Mode/m-p/52377#M10367</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-05-02T04:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Python Pexpect and Check Point Gaia Expert Mode</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Python-Pexpect-and-Check-Point-Gaia-Expert-Mode/m-p/52389#M10370</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/19974"&gt;@Nick_Doropoulos&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi Lisa,&lt;/P&gt;&lt;P&gt;Thank you for raising this query.&lt;/P&gt;&lt;P&gt;Personally, I don't think there is a need for a script here as it's way easier by carrying out the instructions below:&lt;/P&gt;&lt;P&gt;1) Navigate to the firewall's expert mode and type &lt;EM&gt;chsh -s /bin/bash admin&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The above command should put you in expert mode upon the next login.&lt;/P&gt;&lt;P&gt;2) Then, to display the output of certain commands upon login, you will need to edit the .bashrc file inside the /home/admin directory. Once inside the said directory:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;vi .bashrc&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Press Shift + G to go to the bottom of the file followed by '&lt;EM&gt;o&lt;/EM&gt;' to start editing the file.&lt;/P&gt;&lt;P&gt;Next type the commands that you want.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;grep admin /etc/passwd&amp;nbsp;&lt;FONT color="#999999"&gt;&lt;A href="https://www.diebestetest.de/" target="_blank" rel="noopener"&gt;&lt;FONT color="#808080"&gt;diebestetest&lt;/FONT&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;date&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Have a look at this screenshot as well if needed:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Editing the bashrc file.PNG" style="width: 478px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/1048iF03116FE44169F14/image-dimensions/478x348?v=v2" width="478" height="348" role="button" title="Editing the bashrc file.PNG" alt="Editing the bashrc file.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3) Finally, press Escape followed by &lt;EM&gt;:wq&lt;/EM&gt; to save the changes. The end result can be seen below next time you login:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="End Result.PNG" style="width: 374px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/1047i00542BE1C20DA32A/image-size/large?v=v2&amp;amp;px=999" role="button" title="End Result.PNG" alt="End Result.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;4) Repeat the same process on every other firewall.&lt;/P&gt;&lt;P&gt;Since you said that you administer only a few firewalls I believe that would suffice.&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Happy to help! Thanks for leaving a comment.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 07:46:45 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Python-Pexpect-and-Check-Point-Gaia-Expert-Mode/m-p/52389#M10370</guid>
      <dc:creator>Lisa11</dc:creator>
      <dc:date>2019-05-02T07:46:45Z</dc:date>
    </item>
  </channel>
</rss>

