HANA: password policy and password reset
Temporarily relax the HANA password policy, reset a password, then restore it.
How to relax and then restore the SAP HANA password policy parameters, for example to reset a technical user's password without hitting the password history or minimum lifetime rules. See also Hardening SAP HANA's password policy.
The parameters live in the password policy section of indexserver.ini and nameserver.ini.
Temporarily disable history and minimum lifetime
ALTER SYSTEM ALTER CONFIGURATION('indexserver.ini', 'SYSTEM') SET ('password policy','last_used_passwords') = '0' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION('nameserver.ini', 'SYSTEM') SET ('password policy','last_used_passwords') = '0' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION('indexserver.ini', 'SYSTEM') SET ('password policy','minimum_password_lifetime') = '0' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION('nameserver.ini', 'SYSTEM') SET ('password policy','minimum_password_lifetime') = '0' WITH RECONFIGURE;
Reset the password
ALTER USER <user_name> PASSWORD "<new_password>" NO FORCE_FIRST_PASSWORD_CHANGE;
Restore the policy
ALTER SYSTEM ALTER CONFIGURATION('indexserver.ini', 'SYSTEM') SET ('password policy','last_used_passwords') = '5' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION('nameserver.ini', 'SYSTEM') SET ('password policy','last_used_passwords') = '5' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION('indexserver.ini', 'SYSTEM') SET ('password policy','minimum_password_lifetime') = '1' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION('nameserver.ini', 'SYSTEM') SET ('password policy','minimum_password_lifetime') = '1' WITH RECONFIGURE;
Password lifetime for one user
ALTER USER <user_name> ENABLE PASSWORD LIFETIME;
Read the current configuration
On the file system:
sudo find / -name 'indexserver.ini'
grep minimal_password_length -B 10 *
From SQL:
select * from "SYS"."M_INIFILE_CONTENTS" where ("LAYER_NAME" = 'SYSTEM' or "HOST" <> '') and ("FILE_NAME" = 'global.ini' or "FILE_NAME" = 'indexserver.ini');
Notes
- Restore the values (here
5and1) as soon as the reset is done; the values to restore are those your security policy requires.