rodgyq
Last Updated: February 25, 2016
·
1.004K
· uzysjung

Fixing A Broken Sudoers File on an Amazon’s EC2

You have to edit /etc/sudoers file but you can no longer gain root access use sudo

"parse error in /etc/sudoers"

Requirements.

  • EC2 A - (in order to fix)
  • EC2 B - (B is Instance to attach EC2 A master volume)

How to

  1. stop EC2 A
  2. AWS console -Elastic Block Store-volumes detach EC2 A root volume
  3. attach EC2 A root volume to EC2 B device /dev/sdj
  4. sudo mkdir /vol-a
  5. mount /dev/xvdj1 /vol-a