Solved How to SSH into AWS AMI Instance

Status
Not open for further replies.

chance-wmt

Bronze Partner
Advanced Certified
Joined
Nov 23, 2020
Messages
96
Reaction score
30
I have created a 3CX instance with Amazon Machine Image (AMI) on AWS. It did not ask to create an SSH password and was looking into seeing if someone has a way to login. We are using a micro instance and their is no "KVM" console access.
 
I might just have to load a pre-made Debian instance with a predetermined SSH password. I was looking to automating the creation of 3CX instances from our panel anyways.
 
@chance-wmt I believe that first you have to create a Pair/Key, download the Private Key to pem or ppk format and then use it to access the instance via ssh.
 
@chance-wmt I believe that first you have to create a Pair/Key, download the Private Key to pem or ppk format and then use it to access the instance via ssh.
I couldn't get it to work, I think 3CX uses a different user or something?
 
SSH is allowed because it saved the public key of the server to my PC but I keep getting an error about invalid public key which usually means that either 3CX did not automatically retrieve and enable the pem file or it's not using root, which I am definitely using a Private key because I opened it and it said that on top of my pem file. I've been on support with Amazon premium support and they said it's an issue with the AMI that was published.
 
Have you had any luck? I am running into the same issue with the "invalid public key" error.
If you determine the correct way to access via SSH can you please post the details?
Thanks!
It does work,

Make sure you use "admin" as your SSH login.

If you created a .pem file, you will need to use PowerShell.

open PowerShell and modify as needed, replace the "example.com" with your instances information. You can also use the "Public IPv4 DNS" it will look something like this. "ec2-1-11-1-11.compute-1.amazonaws.com". Now, replace "privatekey.pem" with your private key. Done, type "yes" to download the public key from your server to encrypt your session.

Code:
ssh -i "C:\privatekey.pem" [email protected]


If you created a .ppk file you will need to use PuTTY follow the instructions here:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html


I prefer to use PowerShell OpenSSH to SSH into things.
 
Now I can continue to automate everything, I will be looking to integrate Zabbix with our instances possibly too.
 
  • Like
Reactions: AlexisV_3CX
Status
Not open for further replies.

Forum statistics

Threads
111,974
Messages
590,081
Members
164,899
Latest member
mazet