How to reset a Windows password with Ubuntu

If you have forgotten your administrator password for Windows, you can use a Ubuntu Linux live CD or live USB to reset the password. This tutorial will show you how to do that, step by step.

There are many ways to get Ubuntu Linux. You can find more details about that here.

If you run into any problems or have any questions, the folks at the Ubuntu Forums are very helpful and friendly.
I will not be answering any support questions posted as comments here.

Step 1: Boot up Ubuntu

With the Ubuntu CD in your optical drive or with the Ubuntu USB plugged into your computer, make sure your BIOS is set to boot from CD or USB before your hard drive. You can usually enter your BIOS settings by pressing F1, F2, F9, F10, F12, Esc, or Del during bootup, depending on the kind of computer you have.


After Ubuntu boots up, you’ll be asked if you want to try Ubuntu or install it. You definitely want to just try it at this point.

Step 2: Install the password reset software

Installing software on Ubuntu is a bit different from installing software on Windows. Instead of going to a website to download setup files, you just tell the software package manager what you want installed, and it fetches it for you off some servers. It’s a lot like the iTunes App Store or Android Market.

This does assume that you have a working internet connection (wired preferred, but wireless can work, too). If, for some reason, your internet connection isn’t working on the computer you want to reset the password for, you can also download the chntpw .deb using another computer, transfer it over via USB, and then double-click it to install it.


First we want to make sure we have the proper software sources enabled to install chntpw.

Go to System > Administration > Software Sources


Make sure both the Universe and Multiverse repositories are checked (or “ticked,” if you’re not American). Click Close and then, when prompted, click Reload.


Wait for the information about available software to reload.


Go to System > Administration > Synaptic Package Manager

(Note: to those of you who have installed software in Ubuntu before, you actually do—at least as of Ubuntu 10.04—have to go to Synaptic to install chntpw. You can’t install it through Ubuntu Software Center).


Press Control-F or click on the Search button to get the search dialogue up. Then search for chntpw.

(Note: you may be tempted to type chntpw into the search filter but it won’t show up there, since Synaptic hasn’t had time to rebuild the search index for quick filtering.)


Once chntpw pops up in the search results, right-click it and select Mark for Installation.


Click Apply, and then, when prompted, click Apply again.


Wait for the Synaptic to download and install chntpw.

Step 3: Mount your Windows drive

In order for you to reset your Windows password, you have to make the Ubuntu live session know that your Windows drive is available for use. This process is called “mounting.”


To mount Windows, just click on Places and then select your drive. It will be listed by the size of the drive (in this example, 80 GB).

Step 4: Reset your password

chntpw is a terminal-based (not point-and-click) application, so to use it, we’ll have to open up a command-line terminal. Don’t be intimidated. I’ll walk you through the process.


To open the terminal, go to Applications > Accessories > Terminal

I’m going to be offering a lot of explanation for those who aren’t experienced with the terminal and commands, but if you want to just skip over all that stuff, feel free to just pay attention to the terminal commands and ignore the explanations.

cd /media/493D9CB55373C3DD/Windows/System32/config/

First, you’re going to cd (change directories) to the right Windows directory.

Start typing cd /media/ and then hit the Tab key, and it’ll autocomplete with the address of your mounted Windows drive.
Then type W and hit Tab again to get to either Windows (Windows 7) or WINDOWS (Windows XP). Yes, the terminal is case-sensitive, so upper- and lower-case matters!
Type S or s and hit Tab again to get System32 or system32 (again depending on whether it’s Windows 7 or Windows XP—I forget which it is for Windows Vista).
And do the same for config.

Tab completion makes things a lot simpler, so you don’t have to type every single word out. It also avoids the whole typo issue, in case you aren’t a good typist.

Once you’ve gotten to cd /media/name-of-your-windows-drive/Windows/System32/config or cd /media/name-of-your-windows-drive/WINDOWS/system32/config, hit Enter.

sudo chntpw -u username SAM

You should then type in sudo chntpw -u username SAM, where username is your actual username. For example, if your username is susan, it should be sudo chntpw -u susan SAM

After you type that in, hit Enter, and you’ll see a whole bunch of terminal output, most of which you can ignore:

chntpw version 0.99.5 070923 (decade), (c) Petter N Hagen
Hive name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c
Page at 0x7000 is not ‘hbin’, assuming file contains garbage at end
File size 262144 [40000] bytes, containing 6 pages (+ 1 headerpage)
Used for data: 260/20240 blocks/bytes, unused: 9/4144 blocks/bytes.

* SAM policy limits:
Failed logins before lockout is: 10
Minimum password length : 4
Password history count : 4
| RID -|———- Username ————| Admin? |- Lock? –|
| 01f4 | Administrator | ADMIN | dis/lock |
| 01f5 | Guest | | dis/lock |
| 03e8 | susan | ADMIN | |

———————> SYSKEY CHECK <----------------------- SYSTEM SecureBoot : -1 -> Not Set (not installed, good!)
SAM Account\F : 0 -> off
SECURITY PolSecretEncryptionKey: -1 -> Not Set (OK if this is NT4)
Syskey not installed!

RID : 1000 [03e8]
Username: susan
fullname:
comment :
homedir :

User is member of 1 groups:
00000220 = Administrators (which has 4 members)

Account bits: 0x0214 =
[ ] Disabled | [ ] Homedir req. | [X] Passwd not req. |
[ ] Temp. duplicate | [X] Normal account | [ ] NMS account |
[ ] Domain trust ac | [ ] Wks trust act. | [ ] Srv trust act |
[X] Pwd don’t expir | [ ] Auto lockout | [ ] (unknown 0x08) |
[ ] (unknown 0x10) | [ ] (unknown 0x20) | [ ] (unknown 0x40) |

Failed login count: 0, while max tries is: 10
Total login count: 100

This part is important, though:

– – – – User Edit Menu:
1 – Clear (blank) user password
2 – Edit (set new) user password (careful with this on XP or Vista)
3 – Promote user (make user an administrator)
(4 – Unlock and enable user account) [seems unlocked already]
q – Quit editing user, back to user select
Select: [q] >

I would highly recommend typing 1 to blank the password instead of editing the password. After you type that, hit Enter, and you should see

Password cleared!

Hives that have changed:
# Name
0
Write hive files? (y/n) [n] :

Type y and hit Enter to confirm the change. Once you see

0 – OK

then you’re done.


Now you can reboot, and you can log into your admin account with a blank password. Once you’re logged in, you can go to the Control Panel to change your password to something else—something you can remember.

If you’re curious, you can see an older version of this page.

You mean products fail for other reasons?

If you read recent press coverage of Google’s Nexus One, it all seems to make sense. Phones weren’t going to sell well being sold only online without a chance for people to try them in person in a brick-and-mortar store. There wasn’t an advertising campaign for it. Very few articles or blogs about the end of Nexus One seem to think there was a problem at all with the phone itself. No one says the phone wasn’t ready for consumers or that it was too difficult to use.

Yet two years ago when Asus was just starting to be successful with the Eee PC netbook (which came preinstalled with a version of Linux, which Microsoft had to stop right away by resurrecting XP for the first of many times to come), that’s what a lot of the press coverage assumed. Geez. I mean, a lack of advertising campaign or in-person models to try out in the store couldn’t have anything to do with Linux netbooks not selling. It must be that Linux is too hard to use. It must be that Linux isn’t ready for consumers. It must really be that consumers just prefer Windows when given the choice.

Well, there is some truth to that in that the Linux distro Asus chose to put on the Eee PC was essentially crippled (not at all like Ubuntu, PCLinuxOS, Fedora, Debian, OpenSuSE, or any of the other popular distros of the time). It wasn’t even vanilla Xandros. It was a custom Xandros that could be customized only through pasting cryptic commands in the terminal.

Nevertheless, if they’d marketed it correctly, Linux could have been a success. The problem with Linux on “the desktop” (or the laptop or netbook) is the myth of meritocracy. You don’t win by being the best. You win by marketing.

Think about it.

When the iPad was announced, critics focused on the features it didn’t have (no webcam, no Flash, no USB ports), but Apple with its clever marketing department convinced the hoards that the device was magic, so the hoards bought it. If a Linux tablet had been released without Flash, people would have just laughed and said “This is the reason Linux will never succeed—they need to realize the masses use Flash.” But Apple releases a tablet and all of a sudden people are actually saying Flash isn’t necessary. HTML5 is suddenly the wave of the future. Apps for websites are suddenly better than just going to the websites themselves.

I also see a lot of Linux poo-pooers claim Linux doesn’t have any apps, and that Windows users have certain killer apps they need, and that’s why Linux won’t succeed. Well, when Android first started, it had very few apps. In fact, for the end of 2008 and all through 2009, iPhone fanatics kept pointing out how many hundreds of thousands of apps the iTunes App Store had compared to the few thousand Android had. Well, Android now has almost 100,000 apps. If this pace continues, the iTunes App Store and Android Market will probably have the same number of apps by this time next year. The Linux desktop (as opposed to server or embedded) has been around since… the late 90s? Android has been around since 2008. The Linux desktop isn’t mainstream but Android is.

What should we learn from all this? Marketing matters. Being able to test a physical product out yourself matters. Dell selling badly marketed (or even anti-marketed) Ubuntu models on its website isn’t going to sell Ubuntu preinstalled in great numbers, nor are relatively obscure vendors like System76 or ZaReason without a proper store front or brand name recognition.

I would love it if all the bugs in Ubuntu (or some other popular Linux distro) could be fixed. I would love it if some more attention would be paid to ease of use or to making more applications available in the software repositories. I would love that. But that won’t fix Bug #1. If Linux wants to make a dent in the desktop/laptop/netbook world, it needs to give up the idea of being good enough and start embracing the idea of crafting, shipping, and marketing a product—yes, one people can try out in a brick-and-mortar store. In other words, what I said two years ago is still true.

Where is this dreamland in which Windows “just works”?

First of all, I have to say it is not my intention to bash Windows. I am not a Windows hater. I actually like Windows. I use it at work every weekday, and I have found ways to have a generally pleasant experience with it. I like Mac OS X better than Windows, though, and I like Ubuntu Linux better than Mac OS X. I actually am quite a firm believer in using the operating system that works best for you and that all the major platforms have pros and cons.

What I can’t stand is Windows power users having a bad experience trying to migrate to Ubuntu (or some other Linux distribution) and then proclaiming “This is why Windows will always dominate the desktop” or “This is why Linux isn’t ready for the masses.” This in these contexts meaning that they had some problem using a peripheral or getting their wireless to work or whatever. I don’t get it. Really. I don’t understand where the logic in this proclamation is. Such a conclusion comes from several flawed assumptions:

  1. Windows always works.
  2. People choose Windows because it always works.
  3. If Linux always worked, the masses would suddenly flock to Linux.
  4. The problem I had with Linux is a problem everyone would have in Linux.

The truth is that if you work in tech support (I don’t officially, but I have unofficially in my last two jobs), you know that there are problems (many problems) on both Windows and Mac OS X. Windows has been the dominant platform at both my current and previous workplaces, and every single day there are Windows problems abounding—cryptic error messages, printer driver conflicts, wireless drivers preventing laptops from going into standby, blue screens of death, rogue viruses, and frozen applications. Believe me, our official tech support guy doesn’t just sit around twiddling his thumbs. He is busy.

Oddly enough, when people have these constant Windows problems, they don’t decide Windows “isn’t ready for the masses.” They just stick with it. Maybe they’ll say “I hate computers.” Maybe some smug Mac user (who also has problems of a different sort but somehow turns a blind eye to them) will say “I hate PCs” (and by PC they mean Windows PC). Oh, but the second a Windows power user tries Linux and encounters one or two problems, suddenly Windows is this always-working utopia. “I’d never have this problem in Windows.” Sure, buddy. Let me tell you about problems.

Last week, a friend of mine wanted to create a playlist of songs to put on her iPhone for a party she was throwing. Here are the problems she encountered:

  • The iPhone wouldn’t update because it couldn’t connect to the iTunes server
  • After it appeared to start the update, iTunes estimated the update download to take 54 minutes.
  • When the download failed after a half hour, she gave up on getting updated firmware on her iPhone altogether.
  • After installing the Amazon MP3 Installer, the download of the purchased MP3 failed midway through and would not complete or offer a useful error message after clicking retry.
  • The iTunes store worked better for purchasing music but cost more ($1.29 per song instead of $.99 per song)—not really a technical problem but still annoying.
  • She couldn’t sync the songs in her playlist to the iPhone, since the iPhone had been authorized on too many computers already, so she had to call Apple to get them to deauthorize her other computers so she could authorize her current computer.

So that’s “just working”? These are not the only problems she’s had on a Windows computer, and she’s had multiple computers. More importantly, she could not solve all these problems on her own, but she needed me to walk her through almost every step of the way. Is this pretty typical? Yes, actually. As I said before, I’m not even the real tech support guy at work, but people still ask me for help with their Windows problems every single day of the week. It could be Microsoft Word inserting some stupid line that can’t be erased or deleted. It could be Firefox not accepting cookies for website even when you’ve enabled them in Tools > Options. It could be the printer icon not allowing you to delete an errored out print job.

If there were really an operating system that offered you a flawless experience that didn’t require you to be your own tech support or for you to find outside tech support, then a lot of people would be out of jobs. Help desks everywhere would be laying off employees by the tens of thousands.

So does Linux have problems? Sure. It has a lot of problems. But those problems are not the primary (or even secondary or tertiary) reason most people use Windows. Windows’ dominance has mainly to do with inertia, marketing, brand-name recognition, and a near-monopoly on preinstallations. Why should I have to state this obvious fact? Because again and again Windows power users perpetuate this nonsense—because they have spent years or even decades perfecting the art of making Windows a bearable experience—that there are no problems in Windows and that any problem in Linux must be the reason Linux for desktops/laptops/netbooks isn’t more popular than it is.

Further Reading
Linux-for-the-masses narratives
Macs are computers, not magic (part 2)

Should you stick with Windows?

This is a follow-up to my previous post about Macs (trying to provide an unbiased view). The question of Mac v. PC (“PC” meaning “Windows PC,” unfortunately; Linux seems to get left out of the picture completely) often comes up for Windows users thinking about whether they should switch to Mac or not. So the natural flip side to that question is: should you stay with Windows? Is it even worth exploring alternatives like Mac or Linux?

Well, obviously if you like Windows and enjoy using it, you should stick with it. But it’s not usually those who enjoy Windows who ask about Mac or Linux. It’s usually the dissatisfied Windows users—the ones who imagine Mac or Linux offer a perfect world of trouble-free computing.

So, to you restless Windows users, I have a few questions for you (answer honestly):

  • Is vast consumer hardware selection important to you, especially for base models (not as much peripherals)? Would the thought of researching hardware compatibility before a purchase make you shudder?
  • Do you use any Windows-only software? (AutoCAD, OneNote)
  • Do you own a Zune?
  • Do you often like to play the latest commercial game on your computer (not on a gaming console)?
  • Do you hate learning new ways of doing things?

If you answered “yes” to any of those questions, I would highly recommend you stay with Windows. If you worry about Windows crashes and security issues, here is what you should do: back up everything, reinstall Windows, set up a limited user account you use all the time, set Windows updates to install automatically, use Firefox with the NoScript extension, educate yourself about social engineering, and stop pirating! Do all that, and you won’t have to deal with (useless) antivirus software, excessive crashing or slowness, and various security compromises.

Now, if you answered “No” to all of those questions, then you may actually be a prime candidate for a switch to Mac or Linux. Windows is not a bad product, despite all the bad-mouthing it gets from some Mac and Linux zealots. Unfortunately, though, it has been shoved down students’ and employees’ throats all over the world to the point where a lot of folks are just crying out for alternatives.

There are various reasons (which I outlined in my last post) you might want to switch to Mac OS X. The biggest one I can think of for considering it as a Windows alternative over Linux is if you have an iPhone or iPod Touch. Apple has made it difficult to get those devices working without iTunes. The ways to get those working in Linux are complicated and often end up obsolete in the face of firmware upgrades.

You might be a prime candidate for Linux, though, if you are a dissatisfied Windows user who avoids iPods altogether (or has an older-model iPod), especially if you don’t have enough money for a Mac and if you primarily email, web browse, lightly word process, organize photos, and listen to music. Linux can do a lot more than that, too, but if you are a professional graphic designer or video editor, you’re probably better off with a Mac.

The best thing about switching to Linux from Windows is that it can be done in slow steps and for free. You can run Linux inside a Windows session (using portable Ubuntu), you can run Linux as a virtual operating system inside Windows (using VirtualBox or VMWare), you can run Linux as a dual-boot with Windows (using Wubi or a traditional repartitioned drive), you can run Linux as a “live” session that doesn’t affect your hard drive at all (just using your RAM and a CD or USB drive), and, of course, you can install Linux right over Windows (though I would recommend that only as a last step).

I’d really like people to get rid of these stupid OS (operating system) wars. Mac isn’t better. Windows isn’t better. Linux isn’t better. There is no better. There is only better for you. It’s all about assessing your needs and your means. If you need Windows-only programs, you’re going to need it (Sorry, but Wine does not work 100%). If you like Windows, use it. If you like Mac OS X, use it. If you like Linux, use it. You actually can use all three (you don’t necessarily have to choose).

At the end of the day, an operating system is only a platform to run applications and manage devices. If your operating system runs the applications you need and manages the devices you own, then you’re set. Switching from Windows to something else isn’t a magic bullet that brings you to computing nirvana. My wife is happy she switched to Mac, and she would never go back to Windows, but she still has problems from time to time. Likewise, I’m happy I switched to Linux, and I would never go back to Windows, but I still have problems from time to time. Computers aren’t magic. They’re wonderful machines that sometimes have problems.

Inspiron 15n: Dell finally properly prices its Ubuntu option

Every now and then, Linux users get outraged because Dell prices the base model of Ubuntu cheaper than the base model of Windows, but when you match the specs of the two computers, Windows ends up being cheaper. This happened for the Dell Mini 9s when they first came out, for example.

What I’ve noticed is a cycle of Dell pricing Ubuntu cheaper and then offering some kind of promotional discount that makes Windows cheaper. The Linux community complains, and then Dell adjusts the pricing. I created an IdeaStorm idea called Implement a system by which Ubuntu systems automatically get promotional discounts their Windows counterparts get, but it got only 19 votes. No word from Dell on that.

The only official word from Dell on pricing is another IdeaStorm idea (Implemented: Ubuntu Dell is Le$$ Than Windows Dell) that was marked as implemented back in 2007 and that obviously has gone from implemented to unimplemented and back again. A Dell representative wrote on March 24, 2007:

Changed status to **IMPLEMENTED**.

On average, comparably configured Ubuntu systems will be about $50 less than Windows systems.

Well, I’m not sure if they’re going to make this suddenly in favor of Windows again, but I did a price comparison on the Dell Inspiron 15 (Windows Vista) and the Dell Inspiron 15n (Ubuntu Intrepid) today, and Ubuntu is more than US$200 cheaper.

See screenshots for more details:
dell-inspiron-15-with-windows dell-inspiron-15n-with-ubuntu
(American? I haven’t checked the other Dell sites yet) Linux users complaining about pricing? Get them while they’re still hot!