Resettare la password di root in Debian

From RVM Wiki
Revision as of 15:00, 23 December 2014 by Gabriele.vivinetto (talk | contribs) (Created page with "== Debian Squeeze change root password == === Method 1 === * Boot into '''grub''', select '''''single user''''' but '''do not press enter'''. * Press '''e''' to go into '''edi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Debian Squeeze change root password

Method 1

  • Boot into grub, select single user but do not press enter.
  • Press e to go into edit mode.
  • Scroll down to the kernel line, it starts with "linux /boot/vmlinuz-2.6……."
  • Scroll to the end of that line and press space key once and type init=/bin/bash
  • Press Ctrl X to boot

<source lang="bash">

  1. Remount / as Read/Write

mount -rw -o remount /

  1. Change password with

passwd

  1. type new password, confirm and hit enter and then reboot.

</source>

Method 2

  • Boot from another installation of Debian. (One can use a LiveCD to get access to the "/" partition.)
  • Then, mount the partition where you have Squeeze's "/", then changed directory to /mnt/etc
  • Used vim / nano as an editor to edit the file shadow.
  • Find the line starting with root:
  • Delete everything between the first and second colons (:), and the line will now look like:
root::$6$fsdsdgdsg74.:14862:0:99999:7:::
  • Reboot as root without a password.
  • At the end use passwd to set a new root password.
  • Reboot and login as root with the new root password.

References