Logo

Personal Ops Runbook

Personal runbook covering infrastructure operations for Cloud, Kubernetes, OpenStack, and Ceph environments. Includes deployment and teardown procedures, node management, cluster monitoring setup, and incident response workflows compiled from day-to-day operational work. Intended strictly for personal reference — configurations and scripts are environment-specific and not guaranteed to work as-is elsewhere.

Hướng dẫn reset password root trên wmware esxi


Tổng quan.

Giả sử chúng ta có 1 server chạy ảo hóa Esxi, vì lý do nào đó chúng ta quên mất pass root. Hôm nay mình sẽ giúp các bạn cách khắc phục sự cố này.

image

Các bước thực hiện.

Download gparted-live-1.4.0-1-i686.iso

Cho đĩa vào và ưu tiên boot từ CD.

image

Lưu lại BIOS.

image

Sao khi boot vào CD hãy lựa chọn GParted Live (Default settings).

image

Lựa chọn Don’t touch keymap.

image

Lựa ngọn ngôn ngữ, mình chọn 02 British English.

image

Lựa chọn 0 để chọn mode đồ hoạ Continue to start X to use GParted automatically.

image

Sau khi boot vào giao diện bạn để ý phân vùng chứa hệ điều hành thường là phân vùng lớn nhất, mình xác định là /dev/sda5.

image

Hãy vào Terminal.

image

Tại đây hãy gõ các lệnh như dưới.

sudo su
mkdir /boot /temp
mount /dev/sda5 /boot
cd /boot
ls | grep state.tgz
cp state.tgz /temp
cd /temp
tar -xf state.tgz
tar -xf local.tgz
rm *.tgz
cd etc
vi shadow

Hãy xem hình ảnh để trực quan hơn.

image

Tại file shadow hãy xoá phần hash password và lưu lại.

image

Verify lại file shadow để chắc chắn bạn đã thay đổi và lưu file thành công.

image

Tiếp tục gõ các lệnh sau.

cd ..
tar -cf local.tgz etc/
tar -cf state.tgz local.tgz
mv state.tgz /boot
reboot
image

Sau khi khởi động lại, bạn hãy nhập username là root và password để trống, bấm enter.

image

Vào phần Configure Password để đặt lại mật khẩu.

image

Phần Old Password hãy để trống nhé.

image

Chúc bạn thành công.