in Education by
I was given AWS Console access to an account with 2 instances running that I cannot shut down (in production). I would, however, like to gain SSH access to these instances, is it possible to create a new Keypair and apply it to the instances so I can SSH in? Obtaining the existing pem file for the keypair the instances were created under is currently not an option. If this isn't possible is there some other way I can get into the instances? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
According to official AWS documentation, there is a way to can regain access to your instance if you have lost your key pair, which I think might be helpful in your case. Try the following steps to change key pair for your EC2 instance. Step 1: Stop your instance Step 2: Detach the EBS volume from your instance Step 3: Launch a new instance and create a key pair for this instance. Step 4: Attach the same EBS volume that you detached from your original instance to the newly launched instance. Step 5: Modify the authorized key file as shown below: copy ~/.ssh/authorized_keys to /mnt/tmp/home/ubuntu/.ssh/authorized_keys Step 6: Detach this volume and then attach it back to your original instance Step 6: Restart your original instance Step 7: Use the new key pair to connect and login to your original instance.

Related questions

0 votes
    I'm having a problem connecting EBS volume to my Ubuntu EC2 Instance. Here's what I did: 1. From the Amazon ... it to an instance. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I need to know of any way to access a running instance in Amazon EC2. I DON'T have the original keypair ". ... or assign a new keypair? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I need to know of any way to access a running instance in Amazon EC2. I DON'T have the original keypair ". ... or assign a new keypair? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I cannot SSH into my instance - Operation timed out. What could be the reasons why, and what can I do to ... because of memory issues. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm working to set up Panda on an Amazon EC2 instance. I set up my account and tools last night and had no ... would be a great help! Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    How do I change the key pair for my ec2 instance in AWS management console? I can stop the instance, I can ... instance's key pair. Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I have an EC2 instance running (FreeBSD 9 AMI ami-8cce3fe5), and I can ssh into it using my amazon-created ... it can be prevented? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I want to use my Amazon ec2 instance but faced the following error: Permission denied (publickey). I have ... denied (publickey) Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I've created a new linux instance on Amazon EC2, and as part of that downloaded the .pem file to allow me ... Nov 11:20 amazonec2.pem Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I'm unclear as to what benefits I get from EBS vs. instance-store for my instances on Amazon EC2. If ... is still relatively new? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I just signed up for Amazon's new Elastic Beanstalk offering. What I can't figure out is how to SSH to a ... instance on my behalf. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    Sometimes when trying to launch my t1.micro EC2 instance, it cannot be provisioned and Amazon recommends trying ... existing instance? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm currently running an ec2 micro instance and i've been finding that the instance occasionally runs out of memory. ... can be done? Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    How should I use the new AWS EC2 classes (r3, i2) with my existing AMI without recreating the whole system ... only PVM AMI images. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    How can I delete instance in Amazon EC2. I have terminated the instance but still it was showing in ... instance gets terminated Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
...