Linux.com

Home Learn Linux Linux Answers High Performance Do not remember the pass word on the computer so nunable to change. What can I do?
Answers
  • Contact your computer administrator to have your password reset.

    If this is for your home computer I then we will need to know what distro/operating system you are using to help you.

    Answered by mfillpot
    4 years ago
    1 0
  • You should be able to log into Root as long as you know the password for the SU which will give you the option to change passwords for users on your system. As the other person suggested, please provide Distro/OS info.

    Answered by Tony.Ricena
    4 years ago
    0 0
  • Here's a generic answer valid for each distro around.
    Start your PC with a livecd distro, everything carrying a text editor is fine. Now from command line or XWindow start a terminal.
    If you don't know the name of your root partition you need to discover it, type: "fdisk -l" to list all available partitions (mounted or not) in your system, than try to locate your root partition (should be somethin like /dev/sda2 /dev/hda2 or something like that)
    now mount your root partition in your current live tree, assuming you've discovered /dev/hda2 as your root: mount /dev/hda2 /mnt. Please note your /mnt should exist before this operation or create a new different dir (example /tmp/myrootdisk); if you've a readonly file system try to create a dir into /tmp, it works most of the times.

    Now edit your shadow file where password resides, assuming you've mounted your root disk into /mnt you'll have the file in /mnt/etc/shadow
    Inside it you'll have lines like:
    root:$1$AxWj4mie$dFDBbt73lCpX0X35/kJMF/:14378:0:::::
    ben:$1$KxDj4mie$dFDBbt73lCpX0X35/kJMF/:14378:0:::::
    now with your favorite editor (vi, nano, mcedit, ...) delete the string between first and second ":" for the user you want to modify so after your edit it will look like:
    root::14378:0:::::
    ben::14378:0:::::
    and save the file when finished
    If your system allows you to log in as root you only need to change the line where the root user is reported, if you've something like ubuntu configured for denying root user login you need to edit even your common account (if you don't remember that password too of course). Than you're set.
    Take off the live cd and reboot the machine, now when trying to access common user or root you've an empty passwd.

    This method works if
    - You're using shadow passwords, if you're using traditional passwords based on /etc/passwd you need to edit that file
    - You're not using an encrypted file system. If you've encrypted root filesystem when you've installed your linux distro you need to remember a password to access it or the root partition is totally scrambled and you're in serious troubles (encryption is made for this)

    If you're still reading this long post if you need more info please let me know

    Ben

    Answered by ben
    4 years ago
    0 0
Please register/login to answer this question. Click here to login
Similar Questions Found
Questions from category High Performance

Upcoming Linux Foundation Courses

  1. LFD320 Linux Kernel Internals and Debugging
    10 Nov » 14 Nov - Virtual
    Details
  2. LFS426 Linux Performance Tuning
    10 Nov » 13 Nov - Virtual
    Details
  3. LFD312 Developing Applications For Linux
    17 Nov » 21 Nov - Virtual
    Details

View All Upcoming Courses

Community Answers - Search


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board