How to Reset Your Linux Password If You've lost it
Results 1 to 8 of 8

Thread: How to Reset Your Linux Password If You've lost it

  1. #1
    Join Date
    Dec 2001
    Location
    Atlanta,Georgia/USA
    Posts
    278

    How to Reset Your Linux Password If You've lost it

    Hi, Folks. Thought I would post this here to maybe help someone from having to go through what I went through a while back when I lost my password or could not remember it and could not log in to my Linux OS which at the time was Linux Mint 15 I think, with KDE. I think this works in Ubuntu as well. I had a dual boot system with Windows 7 on the first partition and Linux after that. When I lost my password and could not log in to Linux it took me three days of searching the internet on various sites that promised to show you how to reset your password with no luck. It seemed they all left out one important part or step or were so poorly worded they left me scratching my head. I needed step by step 1,2,3, type instructions and couldn't find it.

    After three days of trial and error I finally came up with the following by splicing together info from three or four different "tutorials" i had found. All I can promise is this worked for me a couple times in linux Mint, not sure it will work in all distros.

    Anyway, time to get down to business, feel free to leave any comments, corrections etc you may have as I said though all I know for certain is this worked for me but you have to execute each step exactly as described herein.

    How to Reset Password in Linux

    when you restart the machine, hold down the shift key and that should give you a Grub menu if you have a single boot menu and need to make sure you see the boot menu. Otherwise if you have a dual or multi boot system just boot normally and select the linux option with recovery mode using the up/down arrows. press E to edit the parameters.

    At the next screen Scroll down to the line that looks like this, <linux /boot/vmlinuz-3.2.0-18-generic root=UUID=b8b64ed1-ae94-43c6-92\d2-a19dfd9a727e ro recovery nomodeset:> and replace “ro recovery nomodeset with “rw init=/bin/bash" (without the quotes and “ro” is the letter o not a zero).
    Now push F10 to boot from the edited line.
    You should come to a text screen where you are now logged in as a root user
    You should see this prompt / #.

    ok, now we need to mount the operating system files as “read-write”
    type this: “mount -0 remount,rw /” (without quotes and that's a zero by the way not a letter o) and press enter.

    At prompt (/ #) type passwd username, (example: If your name is john type “passwd john” (case is important!)
    If you've forgotten your username type “ls home>enter” (that's a lower case L) and you'll see a list of users on your system. Then at the prompt go ahead and do “passwd john” or whatever your username is.
    and press enter and you'll see the prompt to enter your new UNIX password. type in your new password
    (NO numbers! more on this later on) hit enter and then at the prompt re-type in your password a second time to confirm. Press enter.

    ok, now we can also reset the root password if you just type passwd and press enter
    you should be able to enter a new password for the root user. Hit “enter”, re-type password to confirm and hit enter.

    Now we need to remount the file system as read only. At the prompt type “mount -0 remount,ro /” (mount-0=zero remount,ro=the letter o not zero)
    (without quotes) and hit enter. Ctrl-Alt-Del to reboot computer and boot normally.
    Please observe all spaces and characters to type them precisely.

    Getting back to numbers in the new password I found the numbers keypad did not work so make your PW all letters. You can change this in terminal once you know your correct password. Terminal> “passwd xxxxx” enter and change using numbers if you like.


    I hope this saves someone from going through what I did when I lost my password for Linux. Have fun!
    HP 6005 Desktop PC
    64 bit Windows 10
    Opera 51 & Microsoft Edge browsers
    Athlon XII X2 B24 3.0 Ghz Processor,
    4GB DDR3 Memory, 750 GB HD
    ATI Radeon HD 4200 Onboard
    _______________
    "Half of being smart is knowing what you're dumb at."

  2. #2
    Join Date
    Apr 2000
    Location
    Sheboygan, WI
    Posts
    53,392
    Nicely written. Thanks for posting it.

    AntiX-15 is my preference.

  3. #3
    Join Date
    Dec 2001
    Location
    Atlanta,Georgia/USA
    Posts
    278
    Thanks Train, that's a high compliment indeed coming from you. I have not tried Antix-15 so I may look into it as something to play around with on my old laptop. I've decided to just keep a single boot system on my main PC these days with Windows only, just upgraded from W-7 Pro to W-10 on my desktop and getting used to it. Windows just serves my main needs and runs all my programs and I don't have a lot of time these days to play around. For three or four years there up until about last year I tried a lot of different Linux distros, not all by any means but a good many. Always seemed to gravitate back to Mint with kde and or Ubuntu though as they seemed to be the most stable.

    As to the password thing, it had me pulling my hair out for a few days there till I figured it out. I could have just re-installed but I had a lot of stuff on there at the time I didn't want to lose and I considered it a challenge at the time to figure it out.
    HP 6005 Desktop PC
    64 bit Windows 10
    Opera 51 & Microsoft Edge browsers
    Athlon XII X2 B24 3.0 Ghz Processor,
    4GB DDR3 Memory, 750 GB HD
    ATI Radeon HD 4200 Onboard
    _______________
    "Half of being smart is knowing what you're dumb at."

  4. #4
    Join Date
    Apr 2000
    Location
    Sheboygan, WI
    Posts
    53,392
    Antix link
    http://antix.freeforums.org/viewtopic.php?f=15&t=5697
    My main rig is Win 7 as is a laptop.

    But this is my main surfing machine.

    Code:
    $ inxi -Fxz
    System:    Host: antix15 Kernel: 4.0.5-antix.1-486-smp i686 (32 bit gcc: 4.9.2)
               Desktop: IceWM 1.3.8
               Distro: antiX-15-V_386-full Killah P 30 June 2015
    Machine:   System: Dell product: Latitude D630
               Mobo: Dell model: 0WM416 Bios: Dell v: A07 date: 01/30/2008
    CPU:       Dual core Intel Core2 Duo T9300 (-MCP-) cache: 6144 KB
               flags: (lm nx pae sse sse2 sse3 sse4_1 ssse3 vmx) bmips: 9972
               clock speeds: max: 2501 MHz 1: 2000 MHz 2: 1600 MHz
    Graphics:  Card: NVIDIA G86M [Quadro NVS 135M] bus-ID: 01:00.0
               Display Server: X.Org 1.16.4 drivers: nouveau (unloaded: fbdev,vesa)
               Resolution: 1440x900@60.00hz
               GLX Renderer: Gallium 0.4 on NV86
               GLX Version: 3.0 Mesa 10.3.2 Direct Rendering: Yes
    Audio:     Card Intel 82801H (ICH8 Family) HD Audio Controller
               driver: snd_hda_intel bus-ID: 00:1b.0
               Sound: Advanced Linux Sound Architecture v: k4.0.5-antix.1-486-smp
    Network:   Card-1: Broadcom NetXtreme BCM5755M Gigabit Ethernet PCI Express
               driver: tg3 v: 3.137 bus-ID: 09:00.0
               IF: eth0 state: down mac: <filter>
               Card-2: Intel PRO/Wireless 3945ABG [Golan] Network Connection
               driver: iwl3945 v: in-tree:s bus-ID: 0c:00.0
               IF: wlan0 state: up mac: <filter>
    Drives:    HDD Total Size: 120.0GB (4.4% used)
               ID-1: /dev/sda model: TOSHIBA_MK1234GS size: 120.0GB
    Partition: ID-1: / size: 108G used: 3.1G (3%) fs: ext4 dev: /dev/sda1
               ID-2: swap-1 size: 2.17GB used: 0.00GB (0%) fs: swap dev: /dev/sda2
    Sensors:   System Temperatures: cpu: 45.0C mobo: N/A gpu: 65.0
               Fan Speeds (in rpm): cpu: N/A
    Info:      Processes: 125 Uptime: 5 min Memory: 291.8/1003.7MB
               Init: SysVinit runlevel: 5 Gcc sys: 4.9.2
               Client: Shell (bash 4.3.301) inxi: 2.2.25
    Saves me lots of hassle , so unless I really need windows, 7 is it.
    Running Win 10 on a old Dell Optiplex 755 with 2 GB of ram. But switch hdd and AntiX-15 Good to go.
    Edge is worthless in my book and use FF or Iceweasle with is a linux version of FF.

  5. #5
    Join Date
    Dec 2001
    Location
    Atlanta,Georgia/USA
    Posts
    278
    Agree totally on Edge, completely worthless but since I never used IE anyway it's no great loss. I've used Opera now for several years almost exclusively. Still have Opera 12 on my laptop with Mint, I actually prefer it to the new Opera Stable which is based on chrome I'm using now in windows but it's kind of a security risk now in windows. Don't worry much about that in Linux though. Never got much into FF or Iceweasle I don't even have any of those on my machines. I do keep Chrome around just for kicks and if Opera acts up but with the new Opera Stable which is based on Chrome,that hardly ever happens any more.
    HP 6005 Desktop PC
    64 bit Windows 10
    Opera 51 & Microsoft Edge browsers
    Athlon XII X2 B24 3.0 Ghz Processor,
    4GB DDR3 Memory, 750 GB HD
    ATI Radeon HD 4200 Onboard
    _______________
    "Half of being smart is knowing what you're dumb at."

  6. #6
    Join Date
    Sep 2015
    Posts
    1
    Great article, but there appears to be an error. You refer to the command
    mount -0 (zero)
    several times. I tried it that way, but no go. I used
    mount -o ...
    and all was well.
    Of course, what I really want to know is how my client who can barely use a mouse managed to mess up her password in the first place, but that's another forum. All is back to normal now.

  7. #7
    Join Date
    Dec 2001
    Location
    Atlanta,Georgia/USA
    Posts
    278
    I really can't account for the difference , all I know is zero worked for me when I originally compiled that little tutorial there when I was using Linux. I haven't used it in a couple of years so whatever works ,anyway I'm glad you got it straightened out thanks for the comments.
    HP 6005 Desktop PC
    64 bit Windows 10
    Opera 51 & Microsoft Edge browsers
    Athlon XII X2 B24 3.0 Ghz Processor,
    4GB DDR3 Memory, 750 GB HD
    ATI Radeon HD 4200 Onboard
    _______________
    "Half of being smart is knowing what you're dumb at."

  8. #8
    Join Date
    Apr 2000
    Location
    Sheboygan, WI
    Posts
    53,392
    May have expired.
    See the
    Code:
    To get more info about password aging for a specific user called vivek, enter:
    # chage -l vivek
    http://www.cyberciti.biz/faq/changin...x-commandline/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •