- CheckMates
- :
- Products
- :
- Quantum
- :
- SMB Gateways (Spark)
- :
- Delete user admin UserScript
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Delete user admin UserScript
Hello!
I am try to delete extra admins in userScripts.
echo "Check Users" > /tmp/check_admins
for USER in $(cat /etc/passwd | grep -E '/bin/bash|/bin/clish' | awk -F: '{ print $1 }')
do
echo $USER >> /tmp/check_admins
if [ "$USER" = "admin" ]
then
echo 'OK' >> /tmp/check_admins
else
# /bin/clish -c "delete administrator username $USER" >> /tmp/check_admins
deluser $USER
echo "User $USER was deleted" >> /tmp/check_admins
fi
done
If I use the command deluser, then the admin is removed from the passwd, but remains in the web and clish interface
If I use the clish command, the admin is not deleted and I get an error: "Unexpected error: attempt to index global 'cgilua' (a nil value)".
If I run this script manually, I get an error: "Could not set administrator: Invalid action: User is logged in". Although the script is run by a different user.
How can I delete extra admins?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Run "save config" at the end
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SMB devices do not have a 'save config' command. We use Checkpoint 1430, 1530 devices.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You never specified that in the original post.
This changes the whole thing. Gaia embedded uses different set of shells and commands. You are using regular Gaia bash commands, which may lead to corrupted admin database on SMB. Soft-reset, if the user is still there, you may need to hard reset do default and reconfigure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Clish command not working in /pfrm2.0/etc/UserScript?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Once again. Native clish commands do. But calling them from bash shell is a different matter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can't solve my problem with this script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regardless of using SMB or not, one should never use the expert mode commands to manage users.
This needs to be done via clish only using the appropriate syntax.
