My computer was stolen the day before yesterday, and I put one of my servers private key in that, the key is password protected, so it should be OK. But the problem is that now I can not access the server.
The server is Ubuntu, Amazon EC2, Root Device: Instance Store. I've been searching this for a whole day, looks like if the server is EBS, then it will be easier to just create an image and launch a new instance. But unfortunately mine is not.
I really hope that some one can give me an advise on how to get access to the server, my user type is root, so no one else can modify the key for me.
I don't know if you can create private key from the public key, and I don't know if you can actually get the public key from Amazon EC2. Please help.
Thank you very much!
Asked
Active
Viewed 1.9k times
20

Jason
- 814
- 1
- 6
- 15
-
2at least i can help by upvoting your question – necromancer Apr 29 '12 at 03:59
-
@agksmehx Thanks man. :-) I know I'm f**ked, but I still want to know if there are anything I can do to avoid rebuilding the server. :-( – Jason Apr 29 '12 at 04:01
-
i am not an expert, are you sure you cannot make an AMI from an instance store? – necromancer Apr 29 '12 at 04:15
-
@agksmehx I think that you need to have SSH command line access to make the image. But I'm not sure either. – Jason Apr 29 '12 at 05:51
1 Answers
10
Try to do like this:
Login to your AWS Management Console, in EC2
tab view, you'll find something like 1 key Pair
, click it, delete your old key pair, then create new pair.
EDIT:
Got a related question HERE
What you could do, is assign one of your Elastic IP's to the instance and route traffic through that normally. Snapshot the instance and bring up a duplicate with a new Keypair. Switch the Elastic IP over to the new instance.
and HERE
The best solution we have been able to come up with is to burn an AMI from the running instance and launch a new instance from that AMI using the new key pair.
How to create your own AMI? HERE. ;)
-
9Thanks for you reply. Of course you can delete one key pair and create a new one. But you cannot assign a new key pair to a running instance. Unless I missed something. – Jason Apr 29 '12 at 05:53
-
2@Jason yes you're right, I just got some related QAs, see the new version of answer – Kjuly Apr 29 '12 at 06:11