Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
SaffaRamma
Participant

Creating users via script/using CPDIR on SMB Devices

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):

$CPDIR/bin/cprid_util -server 10.20.30.40 -verbose rexec -rcmd /bin/clish -c "show configuration"

 

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)?

$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"
Unexpected error: attempt to index global 'cgilua' (a nil value)

$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"
Could not set administrator password-hash: Not valid password hash
Could not set administrator password-hash: Not valid password hash

$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"
Could not set administrator password-hash: Not valid password hash
Could not set administrator password-hash: Not valid password hash

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.

0 Kudos
5 Replies
PhoneBoy
Admin
Admin

Yes, it should be supported.
That said, the canonical path to clish on SMB appliances is /pfrm2.0/bin/clish
If that still doesn't work, recommend a TAC case.

0 Kudos
SaffaRamma
Participant

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.

0 Kudos
Bärbel
Participant

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:

 

cprid_util -server 1.2.3.4 -verbose rexec -rcmd clish -c "set administrator session-settings inactivity-timeout 15"
0 Kudos
G_W_Albrecht
Legend Legend
Legend

Seems that some commands will not work, as found in sk106490: How to remotely reset Admin / Expert password on a Security Gateway:

This procedure is NOT supported for Gaia Embedded appliances. If you attempt to run this command on a Gaia Embedded appliance, you will receive the following error: "Unexpected error: attempt to index global 'cgilua' (a nil value)"

There is also a procedure using different syntax to achieve the same on SMBs:

sk106025 - How to reset the Expert mode password on a Quantum Spark Appliance with Gaia Embedded OS

You could try to use a script on SMB, first lines:

#!/bin/bash -f
source /fwtmp/opt/fw1/tmp/.CPprofile.s

 and call it with the needed parameter values using cprid_util command.

CCSP - CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
Hugo_vd_Kooij
Advisor

Nice try. But then you get a lua error. so that doesn't work either.

<< We make miracles happen while you wait. The impossible jobs take just a wee bit longer. >>
0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events