0

How can I debug a java application deployed in EC2 instance from my Intellij, knowing that I have to use a jump server to connect the EC2 instance with SSH ??

asked Apr 12 at 2:27
1

1 Answer 1

0

Add the debug to your agent to your java program or server


java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar your-app.jar

Use the below command to port forward using your bastion host

ssh -i ~/.ssh/remote.pem -o "ProxyCommand ssh -i jumpboxkey.pem -W %h:%p ec2-user@<bastion-public-ip>" ec2-user@<private-ec2-ip> -L 5005:localhost:5005

Connect Intellij

Also there is a more secured approach to do the same using SSM port forwarding check the below article

https://aws.amazon.com/blogs/mt/use-port-forwarding-in-aws-systems-manager-session-manager-to-connect-to-remote-hosts/

answered Apr 13 at 9:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.