I am currently trying to set up a new domain and configure it for security but it seems that I get stuck at the very beginning. Being more accurate it's asadmin that gets stuck. I created a domain with the following command:
su - glassfish -c '/opt/glassfishv3/bin/asadmin --user MyRoot --passwordfile /opt/glassfishv3/dom2-pwd.conf create-domain --portbase 9000 --savemasterpassword=true --savelogin=true dom2'
That worked quite well without asking me anything. Then I also can do:
su - glassfish -c '/opt/glassfishv3/bin/asadmin start-domain dom2'
...success. After that I just wanted to get a property from that domain:
su - glassfish -c '/opt/glassfishv3/bin/asadmin --port 9048 get *.admin-listener'
Well, and here we are:
[pre]Authentication failed with password from login store: /opt/glassfishv3/.asadminpass
Enter admin password>
Authentication failed for user: MyRoot
(Usually, this means invalid user name and/or password)
Command get failed.[/pre]
Now THAT is strange! The login via web interface works as expected in contrast to the CLI.
Please help, as I also need to make everything secure (including shutting down the admin web interface) from the command line.
P.S.: I'm using the latest stuff (updated through pkg), so it is currently b64 (the complete glassfish, not only web)
In the server log it says the following:
[pre]...FileRealm;MethodName=init;|FileRealm : file=/opt/glassfishv3/glassfish/domains/dom2/config/admin-keyfile|#]
...FileRealm;MethodName=init;|FileRealm : jaas-context=ignore|#]
...FileRealm;MethodName=loadKeyFile;|Reading file realm: /opt/glassfishv3/glassfish/domains/dom2/config/admin-keyfile|#]
...FileRealm;MethodName=authenticate;|File authentication failed for: [MyRoot]|#][/pre]
So glassfish tries to authenticate the admin user against the file realm (.../dom2/config/admin-keyfile) but the information has to be correct otherwise I couldn't login via the web interface.
Message was edited by: chaoslayer