- Products
- Learn
- Local User Groups
- Partners
-
More
It's Here!
CPX 360 2021 Content
Check Point Harmony
Highest Level of Security for Remote Users
Important certificate update to CloudGuard Controller, CME,
and Azure HA Security Gateways
Advanced Protection for
Small and Medium Business
Secure Endpoints from
the Sunburst Attack
Important! R80 and R80.10
End Of Support around the corner (May 2021)
Support,
We reset the admin password, but somehow we forgot the password. Now we need to change the admin CLI passwork for Management Server.
Please Help.
Chetan D. Lad
In R77.x and earlier, you can do this with EmergenDisk: https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solut...
The SK has conflicting information about R80, but if you can still log into SmartConsole, it's possible to reset the admin password for the OS without EmergenDisk.
Here's the process:
I have found success in the past using cprid_util (sk106490) to change the password when below R80.x. As Dameon mentions, the Script Repository is great for this now.
Below are the steps I had used in the past.
1.) /sbin/grub-md5-crypt
a.) Enter Password 2x Times
b.) Copy Hash displayed on screen
2.) $CPDIR/bin/cprid_util -server 10.0.0.x -verbose rexec -rcmd /bin/clish -s -c 'show users'
3.) $CPDIR/bin/cprid_util -server 10.0.0.x -verbose rexec -rcmd /bin/clish -s -c 'set user <USERNAME> password-hash <HASHED PASSWORD FROM STEP #1>'
4.) $CPDIR/bin/cprid_util -server 10.0.0.x -verbose rexec -rcmd /bin/clish -s -c 'save config'
With the cprid_util it is only possible to reset the gateway GAIA password from the management server. I am use this script to execute remote commands.
More see here:
GAIA Easy execute CLI commands from management on gateways
To reset the management server password see this sk:
R77.30: Reset the Gaia Admin and Expert passwords using EmergenDisk USB flash drive
R80.10+ with a user with adminRule: How to reset the Expert mode password in Gaia OS
R80.10+ with SmartConsole connection (steps from @PhoneBoy😞
1) Generate the password hash on a Check Point Appliance in expert mode:
# cpopenssl passwd -1 mypassword
2) On SmartConsole under management object -> select scripts -> One-Time Script
3) Run the Script:
clish -c 'set user admin password-hash mypasswordhash
If anything doesn't help, open a TAC ticket.
Or a solution without Check Point support for VMWare and Hardware without RAID controller:
Attention, you can also destroy your system with this steps.
Should also work on an appliance or OpenServer without a RAID controller. I tried it with an appliance in the LAB.
So I used the best of aforementioned sites and successfully reset the admin password with this procedure on R80.10:
a) Configure the Check Point VM to use a recent Ubuntu/Debian Desktop ISO and boot from CD-ROM. Select Try Ubuntu so you will have a Live environment without installing Ubuntu.
b) Open the Terminal application.
c) Enter the following command: sudo su –
d) Create a mounting point: mkdir /mnt/cp
e) Mount the Gaia filesystem: mount /dev/mapper/vg_splat-lv_current /mnt/cp
f) Change the root directory to the Gaia root: chroot /mnt/cp
g) Backup the current Gaia configuration database: cp /config/db/initial_db /config/db/initial_db_backup
h) Connect to the Gaia configuration database: sqlite3 /config/db/initial_db
i) Query the database using SQLite to locate the current admin password. The last line is the current password hash:SELECT * from revisions WHERE binding=”passwd:admin:passwd”;
j) Update the database using SQLite to change the password to ‘admin’. Replace the text old-pw-hash below with the last hash from step i):UPDATE revisions SET value=”$1$zIVyrIdj$1LBW7Pg6XOcXYIgFPTppY.” WHERE binding=”passwd:admin:passwd” AND VALUE=’old-pw-hash‘;
k) Exit SQLite by entering the following command: .exit
l) Exit chroot and go back to Ubuntu/Debian: exit
m) Unmount the Gaia filesystem: umount /mnt/cp
n) Reboot the Check Point VM by entering: reboot
o) Login to the console, SSH or Gaia Portal using user admin and password admin.
p) When in CLISH or Gaia Portal don’t forget to change the password for user admin (and document it!)
Plan B with a migrate export:-)
1) Install a new managment server with the same IP.
2) Open a CLISH per ssh (do not close this session)
3) Open a second connection in expert mode and start a migrate import.
4) After the migrate import change to the CLISH session and change the admin password.
5) Now save the settings "save configuration"
That's all I can think of:-)
This way works fine😀.
Great point, I didn't fully read that the issue was resetting the admin password on the management server itself.
I've took this one-time script and added it into the script repository. Since arguments can be passed to scripts in the repository, I can pass the username and new password and viola.
Script Body:
export OPENSSL_CONF=$CPDIR/conf/openssl.cnf
clish -s -c "lock database override"
clish -s -c "set user $1 password-hash $($CPDIR/bin/cpopenssl passwd -1 $2)"
Correct.
Same method as using cprid_util but from script repository vs expert CLI.
As @PhoneBoy said in the other thread I had. If you wrap the password line in single quotes, not double, this works as well. Possibly an easier fix than exporting OPENSSL into the script.
Regardless it works for me in both scenarios.
RE: 80.30 gateway
I'm logged in as admin
Is there anyway to decrypt or convert an expert password hash to a string?
If I'm logged in as admin, can I reset both the admin and expert passwords with out knowing either?
Not to revive this thread, but I think it may be relevant here.
For compliance, we are required to change our admin password every 90 days (we are using RADIUS for our personal accounts). By way of this thread we have a valid script that can reset the admin and expert passwords with no issues via scripts repository. The problem comes into play when the admin password has met, or exceeded its 90 day setting. Utilizing the script resets the password successfully (if you log in with it the next time as admin it accepts the password but prompts for the password to be reset again via the interactive login). Is there a way around being prompted for a password change again? The script is running but there is some field/trigger that is not acknowledging that as a formal password change to reset a "counter" for the password-controls setting within clish.
The command in the script is "clish -c 'set user admin password-hash <hash>'"
Example
Current Password: Test123!
Script Rests to: Test456!
When logging in the next time with admin/Test456! it prompts to change password again.
Thanks!
About CheckMates
Learn Check Point
Advanced Learning
WELCOME TO THE FUTURE OF CYBER SECURITY