2
votes

I've made a mistake - disabled a NIC on a AWS EC2 instance. Currently I'm trying to get access to it. Google search gave me 3 possible solutions:

  1. Create VPC and add a NIC for it - that didn't work for me. Actually I couldn't access to it even from another machine inside the VPC.
  2. Detach the volume and attach to other instance. Load a registry hive and try to enable NIC via registry settings - that also didn't work for me. It seems there are about 100 keys that should be changed (created 2 registry snapshot and compare them) - it's not worth a try.
  3. Detach the volume and attach to other instance. Load a registry hive and try to set AutoAdminLogon. And add a script
    netsh interface set interface "Local Area Connection 2" enabled
    to HKLM/.../RunOnce folder.

This third solution doesn't work for me because AutoLogon doesn't work for some reason. I'm sure AutoLogon doesn't work because in the other case the key from RunOnce folder will be removed. But it's still there!

I've create a new intance (let it be Instance0), go to register and set 3 keys: AutoAdminLogon, DefaultUserName and DefaultPassword. Add a key with "netsh ..." to RunOnce folder. Disable NIC, restart the instance and ... it worked! Then I disable NIC on this intance. Create a new intance - Instance1. Attach the volume from Instance0. Load "%Instance0-Windows%\System32\config\SOFTWARE" hive (It's HKLM/Software). Make the same operations as I did, attach the volume to Instace0, start it and ... it doesn't work! My guess is that there are some differences between setting keys for your local machine and settings key using load hive for registry of not the local machine.

Can anyone help me in this problem? The question is not "Why does auto logon not work?" The question is "How to get access to the Instance0?" It seems for me that getting an access via autoLogon would be very easy if autoLogon works. If anyone knows a different method, that would be really appreciated.

3
What do you need from the instance? You could try making an AMI out of it...Pete - MSFT

3 Answers

1
votes

it's easy, just allocate a new NIC in the same advisability zone on the ES2 instance, then attached the new NIC to the instance and allocate new Elastic IP and associate it to the new NIC, then use remote login to log into the EC2 instance using the new Elastic IP.

after login to the ES2 instance you have the choice to reconnect the old local area connection or stay on the new local area connection, best practice is to reconnect the old one because it increase the bandwidth available to your instance.

and have a nice day :)

0
votes

Easy way is to make an AMI from that instance. Then fire up the AMI with User Data Code (Powershell script) to enable the NIC

Amazon Elastic Compute Cloud -> User Data

Enabling and Disabling Network Adapters with PowerShell

0
votes

If anyone else needs this in future this is how i resolved my issue.

Added a new network interface via the console. attached an elastic IP to the new nic connected via RDP to the new elastic IP removed the new nic and reverted back to the original one. disconnected via RDP reconnected on the original and it worked.