Search code examples
jbossjboss7.xmiddleware

Enable ssh in jboss admin console


Is any one can step down how to configure standlone.xml file to enable the SSH in jboss 7.1.1 admin console.

I tried using the below link but it does not work.

Accessing JBoss Management Console over Https in JBossAS 7.1.2

Thanks in advance.


Solution

    1. create a keystore with the following keytool command:
    keytool -genkeypair -alias serverkey -keyalg RSA -keysize 2048 -validity 7360 -keystore server.keystore -keypass mypassword -storepass mypassword -dname "cn=Server Administrator,o=Acme,c=GB"
    
    1. Copy the server.keystore under server's configuration folder

    2. Next, include in your ManagementRealm configuration a server-identities definition which references our keystore as follows:

    <security-realm name="ManagementRealm">
        <authentication>
            <local default-user="$local"/>
            <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
        </authentication>
        <authorization map-groups-to-roles="false">
            <properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
        </authorization>
        <server-identities>
            <ssl>
                <keystore path="server.keystore" relative-to="jboss.server.config.dir" keystore-password="mypassword" alias="serverkey"/>
            </ssl>
        </server-identities>
    </security-realm>
    
    1. Replace the http socket binding with an https socket binding:
    <management-interfaces>
        <http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
           <!-- <socket-binding http="management-http"/> -->
                  <socket-binding https="management-https"/>
        </http-interface>
    </management-interfaces>
    
    1. Check the port binding: the management-https binding will already exist in default socket binding groups, defaulting to 9443. If not, add it with:
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>