BUT a a few days ago, I "accidentally" remove my key. Since Amazon doens't store the private key and (maybe, like you) I didn't have a backup of my key, I was in a funny trouble. Something like lock the car with the keys inside.
Google here, google there and the conclusion: terminate your instance and create another one.
WAIT:
- I'm a Geek, I'll never give up upon a problem like this
- I'm scared with the fact that a lost key can compromise a server (Amazon... think about it)
- I read about people, with important info on the server, who lost everything (do backups, on the next time, right?)
- I like some challenges
- Look at volumes zone (us-east-1b for me)
- Create a new key pair
- Save it on your PC
- Save it on your pen drive (NOW)
- Save t on DropBox (NOW)
- Save it on your gmail (NOW)
- Print it (I'm joking)
- Create a micro instance (AMI) at the same zone
- Associate with your previous created key
- Look at the mount point of your old volume, you'll need later (Ex: /dev/sda1)
- Detach the volume of your old server (WAIT a little bit)
- Attach the volume, of your old server, to the new one
- Choose a mount point like /dev/sdd1
- WAIT, depends on the size of the volume
- Connect to the new server
- Mount the volume
- Copy the file ~ec2-user/.ssh/authorized_keys to the same location of your old authorized_keys
- Umount
- Detach the volume of your old server (WAIT a little bit)
- Attach it to the old server (put the old mount point)
- Start the server
- Go sleep
If you don't like keys try this:
- Look at volumes zone (us-east-1b for me)
- Create a micro instance (AMI) at the same zone
- Associate with your previous created key
- Look at the mount point of your old volume, you'll need later (Ex: /dev/sda1)
- Detach the volume of your old server (WAIT a little bit)
- Attach the volume, of your old server, to the new one
- Choose a mount point like /dev/sdd1
- WAIT, depends on the size of the volume
- Connect to the new server
- Mount the volume
- Chroot into the volume
- Create a user
- Passwd for the user
- Passwd for root
- Edit your /etc/ssh/sshd_config and make sure that you have the both options enabled
- PasswordAuthentication yes
- PermitRootLogin no
- Save it
- Exit Chroot
- Umount
- Detach the volume of your old server (WAIT a little bit)
- Attach it to the old server (put the old mount point)
- Start the server
- Go sleep
Other tests:
The image used to create my server doesn't exists anymore.
So, create a snapshot of my volume and create a new volume based on snapshot, and put this volume to boot at another server doesn't work for me.
- NEVER USE SHIFT+DEL, OK?
- MAKE BACKUPS PERIODICALLY
- Take Care of your Information
- I don't know how much it'll cost you. But If you came here, it'll cost less than your job or your information or something like this
PS1: Sorry about my english
PS2: Some expressions are Portuguese (Brazil) translated to English.
2 comentários:
It's alive, alive!!
Postar um comentário