<?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: Creating users via script/using CPDIR on SMB Devices in Spark Firewall (SMB)</title>
    <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/174192#M8427</link>
    <description>&lt;P&gt;Seems that some commands will not work, as found in &lt;A class="cp_link sc_ellipsis" style="max-width: 840px;" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk106490&amp;amp;partition=Advanced&amp;amp;product=CloudGuard" target="_blank" rel="noopener" data-hasqtip="29" aria-describedby="qtip-29"&gt; sk106490: How to remotely reset Admin / Expert password on a Security Gateway&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;This procedure is &lt;STRONG&gt;NOT&lt;/STRONG&gt;&amp;nbsp;supported for Gaia Embedded appliances. If you attempt to run this command on a Gaia Embedded appliance, you will receive the following error: "&lt;CODE&gt;Unexpected error: attempt to index global 'cgilua' (a nil value)&lt;/CODE&gt;"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;There is also a procedure using different syntax to achieve the same on SMBs:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk106025" target="_blank" rel="noopener"&gt;sk106025 - How to reset the Expert mode password on a Quantum Spark Appliance with Gaia Embedded OS&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You could try to use a script on SMB, first lines:&lt;/P&gt;
&lt;PRE&gt;#!/bin/bash -f&lt;BR /&gt;source /fwtmp/opt/fw1/tmp/.CPprofile.s&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and call it with the needed parameter values using cprid_util command.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2023 15:46:31 GMT</pubDate>
    <dc:creator>G_W_Albrecht</dc:creator>
    <dc:date>2023-03-09T15:46:31Z</dc:date>
    <item>
      <title>Creating users via script/using CPDIR on SMB Devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/150577#M6918</link>
      <description>&lt;P&gt;I know it is possible to execute commands from a management server (SMS) to a centrally managed SMB via CPDIR. For example, the below command works a treat (PS - 10.20.30.40 is not an actual IP I'm using):&lt;/P&gt;&lt;P&gt;$CPDIR/bin/cprid_util -server 10.20.30.40 -verbose rexec -rcmd /bin/clish -c "show configuration"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What does seem to be an issue however is the ability to add local administrators this way (I have tried multiple iterations of the below)?&lt;/P&gt;&lt;P&gt;$CPDIR/bin/cprid_util -server 10.20.30.40 -verbose rexec -rcmd /bin/clish -c "add user newadmin type admin password this_is_my_real_password permission RW"&lt;BR /&gt;&lt;STRONG&gt;Unexpected error: attempt to index global 'cgilua' (a nil value)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;$CPDIR/bin/cprid_util -server 10.20.30.40 -verbose rexec -rcmd /bin/clish -c "add administrator username newadmin password-hash $1$UHVNJb2O$1UXMqCZm9767DZNtoIqYv. permission read-write"&lt;STRONG&gt;&lt;BR /&gt;Could not set administrator password-hash: Not valid password hash&lt;BR /&gt;Could not set administrator password-hash: Not valid password hash&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;$CPDIR/bin/cprid_util -server 10.20.30.40 -verbose rexec -rcmd /bin/clish -c "add administrator username newadmin password-hash '$1$UHVNJb2O$1UXMqCZm9767DZNtoIqYv.' permission read-write"&lt;STRONG&gt;&lt;BR /&gt;Could not set administrator password-hash: Not valid password hash&lt;BR /&gt;Could not set administrator password-hash: Not valid password hash&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The above commands within the quotation marks work fine locally on the SMB device, but running the CPRID commands from the SMS fail with the errors in bold above.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 15:26:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/150577#M6918</guid>
      <dc:creator>SaffaRamma</dc:creator>
      <dc:date>2022-06-10T15:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating users via script/using CPDIR on SMB Devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/150578#M6919</link>
      <description>&lt;P&gt;Yes, it should be supported.&lt;BR /&gt;That said, the canonical path to clish on SMB appliances is&amp;nbsp;/pfrm2.0/bin/clish&lt;BR /&gt;If that still doesn't work, recommend a TAC case.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 15:40:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/150578#M6919</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2022-06-10T15:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating users via script/using CPDIR on SMB Devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/150582#M6920</link>
      <description>&lt;P&gt;Thanks for the quick response! Tried the change in canonical path ($CPDIR/bin/cprid_util -server 10.20.30.40 -verbose rexec -rcmd /pfrm2.0/bin/clish -c "add user testuser type admin password testuser123password permission R") and still no dice! I'll get a ticket raised with TAC.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 15:54:58 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/150582#M6920</guid>
      <dc:creator>SaffaRamma</dc:creator>
      <dc:date>2022-06-10T15:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating users via script/using CPDIR on SMB Devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/174095#M8424</link>
      <description>&lt;P&gt;Was this solved by TAC? I'm also getting "Unexpected error: attempt to index global 'cgilua' (a nil value)" when trying to do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;cprid_util -server 1.2.3.4 -verbose rexec -rcmd clish -c "set administrator session-settings inactivity-timeout 15"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Mar 2023 21:45:54 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/174095#M8424</guid>
      <dc:creator>Bärbel</dc:creator>
      <dc:date>2023-03-08T21:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating users via script/using CPDIR on SMB Devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/174192#M8427</link>
      <description>&lt;P&gt;Seems that some commands will not work, as found in &lt;A class="cp_link sc_ellipsis" style="max-width: 840px;" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk106490&amp;amp;partition=Advanced&amp;amp;product=CloudGuard" target="_blank" rel="noopener" data-hasqtip="29" aria-describedby="qtip-29"&gt; sk106490: How to remotely reset Admin / Expert password on a Security Gateway&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;This procedure is &lt;STRONG&gt;NOT&lt;/STRONG&gt;&amp;nbsp;supported for Gaia Embedded appliances. If you attempt to run this command on a Gaia Embedded appliance, you will receive the following error: "&lt;CODE&gt;Unexpected error: attempt to index global 'cgilua' (a nil value)&lt;/CODE&gt;"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;There is also a procedure using different syntax to achieve the same on SMBs:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk106025" target="_blank" rel="noopener"&gt;sk106025 - How to reset the Expert mode password on a Quantum Spark Appliance with Gaia Embedded OS&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You could try to use a script on SMB, first lines:&lt;/P&gt;
&lt;PRE&gt;#!/bin/bash -f&lt;BR /&gt;source /fwtmp/opt/fw1/tmp/.CPprofile.s&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and call it with the needed parameter values using cprid_util command.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 15:46:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/174192#M8427</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2023-03-09T15:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating users via script/using CPDIR on SMB Devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/186578#M9199</link>
      <description>&lt;P&gt;Nice try. But then you get a lua error. so that doesn't work either.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 11:55:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/186578#M9199</guid>
      <dc:creator>Hugo_vd_Kooij</dc:creator>
      <dc:date>2023-07-17T11:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating users via script/using CPDIR on SMB Devices</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/256349#M13177</link>
      <description>&lt;P&gt;Well, it seems like&amp;nbsp;some Lua code in clish is trying to access the USER environment variable while it's not been set by CPRID, hence the nil value error.&lt;/P&gt;&lt;P&gt;You need to set it first:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;cprid_util -server &amp;lt;ip&amp;gt; -verbose putenv -attr USER -val admin
cprid_util -server &amp;lt;ip&amp;gt; -verbose rexec -rcmd clish -c 'set administrator username &amp;lt;adminuser&amp;gt; password-hash "&amp;lt;hash&amp;gt;" permission read-write'&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The putenv command should remain in effect until the gateway is rebooted.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 23:18:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Creating-users-via-script-using-CPDIR-on-SMB-Devices/m-p/256349#M13177</guid>
      <dc:creator>nmelay2</dc:creator>
      <dc:date>2025-10-22T23:18:04Z</dc:date>
    </item>
  </channel>
</rss>

