Ankur
Ankur

Reputation: 51100

How to set username and password in JBoss

Unfortunately their Wiki is down for maintenance and the web is not being helpful.

How do I add a new user to JBoss so I can login.

In Tomcat you change the tomcat-users.xml file. There seems to be a similarly located and titled file called login-config.xml in the config folder of jboss.

Is it something to do with this file or something else altogether.

Upvotes: 4

Views: 26275

Answers (3)

Suresh
Suresh

Reputation: 518

You can add the user through CLI in Jboss AS 7 which in turn stored in mgmt-users.properties in JBOSS_HOME/domain/configuration & JBOSS_HOME/Standalone/configuration/ directory.

I have an ubuntu system but the step to add the user is same through cli :

  1. Through terminal go to bin directory path of Jboss7
  2. type ./add-user.sh
  3. Then create the type of user which you want.

This link will help you and explain much in details :

http://www.mastertheboss.com/jboss-as-7/adding-users-with-jboss-as-7

Note : for windows you have to run the add-user.bat file instead of .sh

Upvotes: 0

jbatista
jbatista

Reputation: 1002

Like @Ankur said you need to configure the files in the jboss\server\default\conf\props

I think you want to configure your admin console users. So you have to add one line with your user name and password to the jmx-console-users.properties file (e.g: username=password => jbatista=portuguese).

It's important that you don't forget to add the role to the user created above/privileges. Like tomcat or any other Application server the users have one or more roles and the roles have permissions. In this case we want that the user jbatista has the JBossAdmin role so that he could deploy WARs, etc. Like the add user case, we have to add another entry line. But instead of jmx-console-users.properties we'll add the jbatista=JBossAdmin (username=role) line to the jmx-console-roles.properties file

Upvotes: 1

Ankur
Ankur

Reputation: 51100

It's in the users.properties file within jboss\server\default\conf\props

Upvotes: 6

Related Questions