You need to review the client configuration and server side configuration to ensure the client is specifying valid authentication credentials (username/password) and that it matches up with what the server is configured to accept.
If the server is configured to allow the $local it will attempt a file based authentication challenge where if the client can create a file under the $JBOSS_HOME directory then it will be authenticated without checking any further credentials.
This file challenge will only work if the client is running on the same machine as the server and as an operating user that has write access to the $JBOSS_HOME directory.
The file based authentication challenge can be disabled by removing the $local configuration from the authentication section in the JBoss profile xml.
1# Make sure the remote-outbound-connection 's username is correct and that the valid password for that username , which is base64 encoded in the security-realm, is correct. If you use unix you can base64 with the command below, remember if you use echo to add -n so it does not echo a newline else the encoded password will not match.
echo -n "password" | base64
(ii) for the server side, also try the recommendations in  as well.
The configuration appears to be correct and I am connecting from the same computer and I have access to the $JBOSS_HOME files. Indeed, it works when I don't specify a user to jboss-cli.sh. It's when I do specify a user with the --user=sean option that jboss-cli.sh appears to disable using local authentication. So I'm looking for a way to authenticate locally with a specified user when connecting with jboss-cli.sh.
Did you try adding the user "sean" using the add-user.sh script.
I did try the below steps :
1> Configured my host.xml as below ;
<local default-user="$local" allowed-users="abc"/>
2> Add the user "abc" using add-user.sh script
$ ./add-user.sh abc password@123
Added user 'abc' to file '$JBOSS_HOME/standalone/configuration/mgmt-users.properties'
Added user 'abc' to file ''$JBOSS_HOME/domain/configuration/mgmt-users.properties'
$ ./jboss-cli.sh -c --user=abc
Authenticating against security realm: ManagementRealm
Please let me know if this resolves.
1 of 1 people found this helpful
The CLI does disable local authentication once a username is specified, this is taken as an indication that local authentication is not desired.
Which WildFly version are you using? I would need to double check but it may be possible to override this with an authentication client configuration from WildFly 11 onwards.
I am using Wildfly 11.