หากลืม passwd root debian

ปกติ debian boot menu grub จะมี recovery mode ให้อยู่แล้ว (single) แต่ตอนเข้าไป ก็จะเจอ ถาม password อยู่ดี (Etch ส่วน sarge ไม่แน่ใจ)
กรณีที่ลืม passwd root ให้เพิ่ม parameter ดังนี้

เพิ่ม init=/bin/bash หรือ init=/bin/sh ต่อท้าย คำว่า single โดยเคาะวรรค 1 ครั้ง

หลังจาก boot จะเข้า prompt เลย แต่ยังสั่ง passwd root ไม่ได้ เพราะ mount ro อยู่ ให้สั่ง

#mount / -o rw,remount

จากนั้น สั่ง passwd root ได้เลย

เสร็จแล้ว สั่ง
#/etc/init.d/reboot stop
ใช้งานปกติ

วิธีนี้ support ubuntu ด้วยครับ

อ้างอิง http://www.ubuntuclub.com/node/64

Re: หากลืม passwd root debian

ขอบคุณมากครับ

Re: หากลืม passwd root debian

แล้วถ้าไม่ต้องการให้ กู้คืนพาส ได้ต้องทำอย่างไรครับ

แบบว่ากลัวใครเอาวิธีนี้มาแฮค ระบบที่หน้าเครื่องจัง

Re: หากลืม passwd root debian

ที่มา http://www.debiantutorials.org/content/view/40/227/

/boot/menu.lst

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password top-secret
# password --md5 $1A$B5zFN9$dRKe5^f3Hd1t14Lk0e6NMoE5P
# password topsecret <<<< เปลี่ยน password ตรง topsecret เป็นของเราเอง

เอา # ออกให้หมด
เลื่อนลงไปเรื่อยจนถึงบรรทัด

title Debian GNU/Linux, kernel 2.6.8-2-k7
root (hd0,0)
kernel /vmlinuz-2.6.8-2-k7 root=/dev/hda2 ro
initrd /initrd.img-2.6.8-2-k7
lock
savedefault <<<<<< เพิ่มสามบรรทัดนี้เข้าไปใต้ single mode น่ะครับ boot ปรกติ อย่าไปทำล่ะเดี่ยวเวลา oot จะถาม pass
boot

เท่านี้ก็เข้า single mode แบบถาม pass แล้วครับ

จะแกะจะแคะ ก็คงต้อง rescue mode
หรือไม่ก็ทำตามวิธี คุณ xxxkung เอา hdd ไป mount กับเครื่องอื่น

เอามาฝากกันสำหรับ ท่านที่ไม่อยากให้คนอื่นมายุ่งกับเครื่องเรามากนัก

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <blockquote> <img> <h3> <h4> <h5>
  • Lines and paragraphs break automatically.
  • E-Mail addresses are hidden with reCAPTCHA Mailhide.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.