Wildfly 12 管理指南的第 3.3 节描述了添加用户以便能够访问 Wildfly 管理控制台的过程:
为了操作文件和添加用户,我们提供了实用程序 add-user.sh 和 add-user.bat 来添加用户并生成哈希,要添加用户,您应该执行脚本并遵循引导过程。add-user 实用程序的详细信息将在稍后描述,但为了访问管理界面,您需要输入以下值:-
如果验证通过,您将被要求确认是否要添加用户,并且属性文件将被更新。
For the final question, as this is a user that is going to be
accessing the admin console just answer 'n' - this option will be
described later for adding slave host controllers that authenticate
against a master domain controller but that is a later topic.
Updates to the properties file are picked up in real time so either
click 'Try Again' on the error page that was displayed in the browser
or navigate to the console again and you should then be prompted to
enter the username and password to connect to the server.
There are a couple of potential pitfalls when running the add-user utility:
- You must select option a) (Management User) for the type of user.
- You must use realm ManagementRealm, though this should happen automatically if the type of user being added is Management User.
But rather than diagnosing what went wrong, it's easier just to try adding another user, following the directions given in the documentation shown above. For reference, here's a screen shot of what I did, where the yellow horizontal bars are points at which I submitted something from the keyboard:
After running add-user.bat I was able to login to the Admin Console (http://localhost:9990) using the user I had just created, and no server restart was necessary. My environment was Eclipse Photon on Windows 10.
If you are still having problems, open the file mgmt-users.properties to see whether your user was added successfully. In my case a line was added for the new user that looked like this:
skomisa=82fa5e2f2de46d60adf210bb95d461f3