Navigate to the EC2 Dashboard. Find your instance's Public/Private IP address.
Ensure Security Group allows SSH port 22 from your source network.
From your terminal or command prompt. Run below command
ssh -i /path/key-pair-name.pem instance-user-name@instance-ip-address
The following is an example response.
The authenticity of host 'ec2-198-51-100-1.compute-1.amazonaws.com (198-51-100-1)' can't be established.
ECDSA key fingerprint is l4UB/neBad9tvkgJf1QZWxheQmR59WgrgzEimCG6kZY.
Are you sure you want to continue connecting (yes/no)?
(Optional) Verify that the fingerprint in the security alert matches the fingerprint. If these fingerprints don't match, someone might be attempting a man-in-the-middle attack. If they match, continue to the next step.
Enter Yes. You see a response like the following:
Warning: Permanently added 'ec2-198-51-100-1.compute-1.amazonaws.com' (ECDSA) to the list of known hosts.