I mistakenly have source .bash_profile in the bashrc file and vice versa. Now when I tried to ssh into the machine (ec2), it will stuck at loading bash and get connection closed in a second. Is there a way I could fix it? Could I mount the disk to another ec2 instance to fix the bash files?
Asked
Active
Viewed 245 times
2
John M.
- 143
1 Answers
2
You need to:
- Create another EC2 instance, or use another EC2 instance you have in your VPC,
- Detach the EBS from the faulty EC2 instance,
- Attach this EBS (as a secondary drive) into the EC2 instance you created in step 1.
- Fix the issues you have on your files,
- Detach it again from this instance and attach it to the "original" EC2 instance
You shold be able to restore access to your EC2 instance.
Algeriassic
- 1,719
- 11
- 10