<page xmlns="http://projectmallard.org/1.0/"
      type="topic" style="problem"
      id="user-forgottenpassword">

  <info>
    <link type="guide" xref="user-accounts#passwords"/>
    <desc>Advanced techniques for resetting your password</desc>
    <revision version="13.10" date="2013-10-23" status="outdated"/>
    <credit type="author">
      <name>GNOME Documentation Project</name>
      <email>gnome-doc-list@gnome.org</email>
    </credit>

    <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
  </info>

  <title>I forgot my password!</title>

<comment><cite date="2011-06-07">mimico</cite><p>These instructions were written and tested using gnome3 from ppa.  I attempted following them on Fedora15 and locked the system out completely (had to reinstall os).  There is still hope, but getting this page accurate and safe (so users don't completely lock themselves out) will be very time consuming.  Perhaps distro specific pages are needed for this topic?</p></comment>

<comment><cite date="2011-04-03">shaunm</cite><p>Marking final for 3.0.
This could use some work for 3.2. There are some less drastic things.
Like if there's another admin user on your computer, have them reset
your password in the user accounts settings.</p>
<p>Also: merge two grubs instructions (almost equal), use clicky-clicky
instructions as much as possible, and let's get some real keyring docs
integrated in gnome-help then link there.</p>
</comment>
  <p>
     It is important to choose not only <link xref="user-goodpassword">a good
 and secure password</link>, but also one that you can remember. If you have
 forgotten the password to log in to your computer account, you can follow the
 following steps to reset it.
  </p>
  <note style="important">
  <p>
     If you have an encrypted home directory, you will not be able to reset a
 forgotten password.
  </p>
  </note>
  <p>
  If you simply want to change your password, see <link xref="user-changepassword"/>.
  </p>

  <links type="section"/>

  <section id="reset-password-grub2"><title>Reset password using Grub</title>
     <steps>
         <item>
           <p>
           Restart your computer, and hold down <key>Shift</key> during bootup
 to get into the Grub menu.
           </p>
           <note style="tip">
           <p>
           If you have a dual-boot machine and you choose at boot time which
 operating system to boot into, the Grub menu should appear without the need to
 hold down <key>Shift</key>.
           </p>
           </note>
           <note>
           <p>If you are unable to get into the Grub boot menu, and therefore cannot choose to boot into recovery mode, you can <link xref="user-forgottenpassword#live-cd">use a live CD to reset your user password</link>.
           </p>
           </note>
          </item>
          <item>
           <p>
           Press the down arrow on your keyboard to highlight the line that ends with the words 'recovery mode',
then press <key>Enter</key>.
           </p>
          </item>
          <item>
           <p>
           Your computer will now begin the boot process. After a few moments, a <gui>Recovery Menu</gui> will appear.
           Use your down arrow key to highlight <gui>root</gui> and press <key>Enter</key>.
           </p>
          </item>
          <item>
           <p>
           At the <cmd>#</cmd> symbol, type:
           </p>
           <p>
           <cmd>passwd <var>username</var></cmd>, where <var>username</var> is the username of the account you're changing the password for.
           </p>
          </item>
          <item>
           <p>
           You will be prompted to enter a new UNIX password, and to confirm the new password.
           </p>
          </item>
          <item>
           <p>
           Then type:
           </p>
           <p>
           # <cmd>reboot</cmd>
           </p>
          </item>
     </steps>
     <p>
       After you successfully log in, you will not be able to access your keyring
 (since you don't remember the old password).  This means that all your saved
 passwords for wireless networks, jabber accounts, etc. will no longer be
 accessible.  You will need to <link xref="#delete-keyring">delete the old
 keyring</link> and start a new one.
     </p>
  </section>
    <section id="live-cd"><title>Reset password using a Live CD or USB</title>
     <steps>
         <item>
           <p>
           Boot the Live CD or USB.
           </p>
          </item>
          <item>
           <p>
           Mount your drive.
           </p>
          </item>
          <item>
           <p>
           Press <keyseq><key>Alt</key><key>F2</key></keyseq> to get the <gui>Run
           Application</gui> window.
           </p>
          </item>
          <item>
           <p>
           Type <cmd>gksu nautilus</cmd> to launch the file manager with system-wide privileges.
           </p>
           <note style="tip">
           <!-- Translators: do not translate the word "home". -->
           <p>
             Within the drive you just mounted, you can check that it is the right
             drive by clicking <gui> home </gui> and then your username.
           </p>
           </note>
          </item>
          <item>
           <p>
           Go to the top-level directory of the mounted drive.  Then go into the <gui>etc</gui> directory.
           </p>
           <p>
           Locate the 'shadow' file and make a backup copy:
           </p>
           <steps>

           <item><p>
           Right-click on the shadow file and select <gui>copy</gui>.
           </p></item>
           <item><p>
            Then right-click in the empty space and select <gui>paste</gui>.
           </p></item>

           <item><p>
                      <link xref="files-rename">Rename</link> the backup "shadow.bak".
           </p></item>
           </steps>
          </item>


          <item>
           <p>
           Edit the original "shadow" file with a text editor.
           </p>
          </item>

          <item>
           <p>
           Find your username for which you have forgotten the password.  It
 should look something like this (the characters after the colon will be different):
           </p>
           <p>
           username:$1$2abCd0E or
           </p>
            <p>
           username:$1$2abCd0E:13721a:0:99999:7:::
           </p>
          </item>
          <item>
           <p>
         Delete the characters after the first colon and before the second
 colon. This will remove the password for the account.
           </p>
           <p>
           Save the file, exit out of everything and reboot your computer without
 the live CD or USB.
           </p>
          </item>
          <item>
           <p>
           When you boot back into your installation, click your name in the menu bar. Open <gui>My Account</gui> and reset your password.
           </p>
          </item>
          <item>
          <p>
            For <gui>Current password</gui> do not enter anything, as your
 current password is blank.  Just click <gui>Authenticate</gui> and enter a new
 password.
          </p>
          </item>

     </steps>
     <p>
       After you successfully log in, you will not be able to access your keyring
 (since you don't remember the old password).  This means that all your saved
 passwords for wireless networks, jabber accounts, etc. will no longer be
 accessible.  You will need to <link xref="#delete-keyring">delete the old
 keyring</link> and start a new one.
     </p>
  </section>


  <section id="delete-keyring">
    <title>Get rid of the keyring</title>

    <note style="warning"><p>This will delete all your saved passwords for wireless
    networks, instant messaging accounts, etc. Only do this if you can't remember
    the password you used for your keyring.</p></note>

  <steps>
   <item><p>
    Go to your Home folder by typing 'home' in the <gui>Dash</gui>.
   </p></item>
   <item><p>
    Press <keyseq><key>Ctrl</key><key>h</key></keyseq> (or click
 <guiseq><gui>View</gui><gui>Show Hidden Files</gui></guiseq>.)
   </p></item>
   <item><p>
    Double click on the folder <file>~/.local/share</file>.
   </p></item>
   <item><p>
   Double click on the folder called keyrings.
   </p></item>
   <item><p>
   Delete any files you find in the keyrings folder.
   </p></item>
   <item><p>
   Restart the computer.
   </p></item>
 </steps>
<p>
 After you restart and log in you will be asked to enter your wireless networks
 password.
</p>
  </section>

</page>
