How to change h2 db password? - wso2

i can’t change a password for H2 db. I tried to do it with command:
chpasswd.sh --db-url "jdbc:h2:repository/database/WSO2CARBON_DB" --db-driver org.h2.Driver --db-username ... --db-password ... --username ... --new-password ...
When i start the command, it ends successfully.
But password are not changed.
IS doesn't start with a new password, it starts with an old password.
How to change a password for H2 db?

WSO2 product provided "chpasswd.sh" script is to change the admin password of the product and it has nothing to do with h2 database password.
If you are trying to change the H2 database password you will have to login to h2 console and update the db user password. Following are the steps.
You can download the h2 console form[1]. After that unzip it and go to h2/bin folder. Then start h2 console with below command.
sh h2.sh
Now you can access the h2 console in the browser (http://localhost:8082) and access the db with db path and current credentials. Then run the below SQL to update the DB password.
ALTER USER wso2carbon SET PASSWORD 'NEW_PASSWORD'
After this change the WSO2 product will not start due to the db password update. You will have to update the db password in "repository/conf/datasources/master-datasources.xml" file.
Also, it is important to mention that H2 is not recommended for WSO2 products in production use.
[1] http://www.h2database.com/h2-2017-06-10.zip

You can use one command from the followings to change the admin user password of the H2 database.
sh chpasswd.sh --db-url "jdbc:h2:repository/database/WSO2CARBON_DB" --db-driver "org.h2.Driver" --db-username "wso2carbon" --db-password "wso2carbon" --username "admin" --new-password "admin123"
sh chpasswd.sh --db-url "jdbc:h2:repository/database/WSO2CARBON_DB" --username "admin" --new-password "admin123"
If you still face the same issue, mention the WSO2 product and the product version which you are trying to change the admin password.

I assume you are following this document. Please note that this is only used when you don't know the admin password and need to reset it. If you know the current password, you may just follow this.
By default, WSO2 IS comes with a LDAP userstore. You can check the active userstore by checking "UserStoreManager" at [IS_HOME]/repository/conf/user-mgt.xml. More info here.
If it is JDBC, you have to find the relevant DB from the [IS_HOME]/repository/conf/datasources/master-datasources.xml by checking the dataSource name in user-mgt.xml and follow the steps in this guide.
If it is LDAP, you may have to change the password by connecting to that ldap via a tool like Apache Directory Studio.

Related

How to change the default admin password in ActiveMQ Artemis

I've checked the docs, but so far haven't found how to change the default admin password in ActiveMQ Artemis 2.27.1 created when using the artemis create command.
Here are the contents of the etc/login.config:
activemq {
org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule required
debug=false
reload=true
org.apache.activemq.jaas.properties.user="artemis-users.properties"
org.apache.activemq.jaas.properties.role="artemis-roles.properties";
};
These are the contents of artemis-users.properties:
admin = ENC(1024:EE12ADBFA02C8DB4AF73E22F44C9BD2C12861A2CD01186CA07A874FAA824A757:BA04C1C3F55B0F68EFB2804BB001EAC2C5105EC1662DCBF96E158F9DA3E0C1BB9D8ECA2FF77BBD391938BCB1E69D865322981AB134BF81B1378AFBBE9C040350)
#admin = ENC(1024:389da8e6db1d6dc50b300ec99ea5604a)
I tried masking the the password as described here, (this is the commented admin), but got invalid credentials when I tried to login after restarting the server.
I generated it like this:
./artemis mask <plaintextPassword>
By default credentials are stored in the etc/artemis-users.properties. Each line represents a user and its password in the format:
<user> = <password>
Passwords are hashed by default and stored using the ENC() syntax, but you can use plain text password if you want. Also, by default any changes to artemis-users.properties and artemis-roles.properties are reloaded automatically (since reload=true in login.config) so there's no need to restart the broker.
More details are available in the documentation for the PropertiesLoginModule.
If you want to update the file manually with a hashed password you need to use the following command in the bin directory:
$ ./artemis mask --hash <password>
This is documented in the "Masking Passwords" chapter.
Additionally, if you have at least one valid, working user account with the manage permission or if you have anonymous login enabled then you can use the user commands to list, add, remove, and reset users. As before, more details can be found in the documentation.

Logging into PHPMYADMIN

My website runs off of an AWS server. I went to login to phpmyadmin and placed in the username and password that matches the username and password in config.inc.php and I get the error:
The user name or password you entered for this area on ___________:80 was incorrect
Any suggestions on how I can fix this?
phpMyAdmin doesn't have user accounts, when you enter your credentials in the login field those are passed on directly to MySQL (more information).
The only time you should need to have your username and password in config.inc.php is if you're using the "config" auth_type, in which case you aren't prompted at all when logging in.
But the thing is, that doesn't sound like a phpMyAdmin error message. Perhaps you have some other means in place of protecting your phpMyAdmin installation, such as a .htaccess file or Apache configuration directives.
I suggest starting with the command line client, see if you can log in with the username and password you have. Next, look at the phpMyAdmin configuration, config.inc.php, and for testing purposes I suggest you use auth_type cookie. That way, if you get a popup login dialog you know something else is restricting you. With auth_type cookie, phpMyAdmin displays the username and password fields on a web page form rather than a popup dialog. Finally, check your webserver error log for any hints; it might log more information about where this authentication is configured.

WSO2 Identitiy Server Password change failing with "Can not access the directory service for user"

I am attempting to setup both the Password Change and Password Reset features.
When I attempt to change my test accounts password I see this message
{org.wso2.carbon.identity.password.mgt.ChangePasswordServlet} - Change Password Failed
org.wso2.carbon.user.mgt.common.UserAdminException: Can not access the directory service for user : <my test account>
I am using Active Directory, I am using an LDAPS connection, the connecting user does have permission to change the password.
I can login to federated services using the test account.
Thanks,
...pat
This is Ellucian's distribution 2.0.2 of WSO2 Identity Server 5.1.0.
If the AD is the PRIMARY userstore, then in user-mgt.xml file, you need to add credentials of a administrative level user account of AD.
<Property name="ConnectionName">uid=admin,ou=system</Property>
<Property name="ConnectionPassword">admin</Property>
If the AD is a secondary userstore, then in the particular userstore's configuration, you need to do the same as mentioned above.
It turns out that I needed to alter my Referral setting from 'ignore' to 'follow'. Once I made that change both Password Change and Password Reset features started to work.
...pat

How to get UDDIPublisher permission for a user in wso2 to run JAXR sample

I am trying to run JAXR sample in Governance Registry in WSO2 which deals with UDDI support.It say before running I should add a user with UDDIPublisher Permission to scoutv3.properties file .I dont know which username and password I need to add to this file in order to run the sample.Please help.
The role which user belongs to should have UDDIPublisher permission to publish a service to UDDI registry. Therefore you should add a valid username and password in scoutv3.properties file (instead of root/root).
To tryout this sample you can use the admin/admin for userid and password. (admin has all the permissions)

Oracle APEX 4.2.2 ADMIN cannot login

Oracle 11gR1 EE
Linux RHEL 6.3
APEX 4.2.2
APEX Listener 1.1.4
Just upgraded from 4.1.1 and changed the ADMIN password as part of the post-installation (using apxchpwd.sql). I was able to login once as ADMIN and I changed the setting in APEX to not ask for password reset at login for the user ADMIN.
Now I cannot log in as 'ADMIN' at all and when I use the apxchpwd.sql script again, it does not change the password (no errors during the execution of the script but the 'new' password does not work).
What is going on?!?
Other users can log in btw.
Searching only produces a multitude of possible solutions that include reinstalling from scratch after deleting users FLOWS_030000, APEX_040100, APEX_040000 (to which I say 'you must be kidding!).
Any ideas?
It is possible your ADMIN account is locked. When trying to log into the INTERNAL workspace, do you get an error message saying "The account is locked."?
If so, find out the security_group_id of your INTERNAL account (usually 10):
SELECT workspace_id
FROM apex_workspaces
WHERE workspace = 'INTERNAL';
Then, log onto sqlplus (SYS as SYSDBA) and type:
SQL> alter session set current_schema = APEX_040200;
Session altered.
SQL> begin
wwv_flow_security.g_security_group_id := 10; --replace your security_group_id accordingly
wwv_flow_fnd_user_api.UNLOCK_ACCOUNT('ADMIN');
commit;
end;
/
You should now be able to log in with the password you set with apxchpwd.sql