Proof of concept:
- Terminal 1:
- SSH to remote host
- Start a Java process with JMX registry port 50004, RMI callback
port 50005, and RMI hostname pinned to localhost:
java -Dcom.sun.management.jmxremote.port=50004 -Dcom.sun.management.jmxremote.rmi.port=50005 -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -cp /some/jar/file main.class
- Terminal 2: