Đôi khi chuyên gia hệ thống cần đặt lại mật khẩu AWS EC2 instance. Bài viết hướng dẫn reset qua Automation Document, cũng có bài reset qua System Manager (đọc tại đây).
Khi thực thi automation document AWSSupport-ResetAccess, nó thực hiện các bước sau để reset mật khẩu Windows:
- Tạo và cấu hình VPC
- Tạo subnet
- Khởi chạy Windows Server helper instance
- Dừng instance mục tiêu, tạo backup
- Gán volume root của instance mục tiêu vào helper instance
- Dùng Run Command chạy EC2Rescue trên helper instance
- Gán lại volume root và khởi động lại instance mục tiêu
- Dọn dẹp tài nguyên tạm, trừ backup AMI
Quy trình gồm 2 bước: thu thập Instance ID và thực thi automation document.
Bước 1: Thu Thập Instance ID
Bước 1 thu thập Instance ID từ instance EC2 không truy cập được do quên mật khẩu.
- Đăng nhập AWS Management Tools
- Nhấn Services chọn EC2
- Nhấn Running instances
- Chọn instance nhấn tab Description
- Copy Instance ID vào clipboard. Ví dụ: i-07df312d5e15670a5. Cần Instance ID này cho automation document bước 2.

Bước 2: Thực Thi Automation Document AWSSupport-ResetAccess
Bước 2 tạo automation document kích hoạt lệnh AWSSupport-ResetAccess reset mật khẩu Windows.
- Nhấn Services tìm AWS Systems Manager. Mở khi tìm thấy.

- Bên trái cửa sổ, nhấn Automation dưới Action & Change
- Nhấn Execute automation
- Gõ AWSSupport-ResetAccess dưới Automation document
- Nhấn automation document AWSSupport-ResetAccess chọn Next

- Chọn Simple execution
- Nhập instance id dưới Input Parameters > InstanceId như ảnh

- Nhấn Execute. Tiến trình hiển thị dưới Execution status.

- Nhấn Automation dưới Action & Change xem execution ID

- Khi thực thi thành công, hiển thị dưới Status. Execution ID f079e28c-ffb3-4de2-83e4-fb2c5974f431 thực thi thành công.

- Nhấn Execution ID truy cập mật khẩu
- Mở rộng Outputs xem thông tin mật khẩu mới.