2回答
- 新しい順
- 投票が多い順
- コメントが多い順
1
I FIXED IT! You basically build an instance from a snapshot, but add a launch script which runs as root to change the permissions on your sudoers file. Then you can edit sudoers as a non root user. Then you make another snapshot instance with another launch script that sets the permissions back to normal.
- create a snapshot of your instance
- create a new instance from the snapshot, but click on the +Add Launch Script
- add the following launch script: chmod 777 /etc/sudoers
- Connnect to the instance and modify your sudoers file back too normal (you may have to wait a few seconds for the launch script to apply the permission change)
- reboot
- create a snapshot of the instance
- create another instance from the new snapshot, click on +Add Launch Script
- add the following launch script: chmod 440 /etc/sudoers
- Connect to the instance and test sudo -s (you may have to wait again for the launch script to apply the permission change)
- Detach IP from original instance. Attach to new instance
- Reset all firewall rules
- Delete other instances
回答済み 2年前
0
oh man that's a weird coincidence, I just did exactly the same thing tonight! I mangled my sudoers file cause I forgot I was supposed to use visudo not nano. Watching this for answers...
回答済み 2年前
関連するコンテンツ
- 質問済み 3ヶ月前
- AWS公式更新しました 9ヶ月前
Worked perfectly - Thanks!