Thursday, 12 April 2012

Change or Reset Windows Password from a Ubuntu Live CD

If you can’t log in even after trying your twelve passwords, or you’ve inherited a computer complete with password-protected profiles, worry not – you don’t have to do a fresh install of Windows. We’ll show you how to change or reset your Windows password from a Ubuntu Live CD.
This method works for all of the NT-based version of Windows – anything from Windows 2000 and later, basically. And yes, that includes Windows 7.
Note: If you have files on your hard disk encrypted using built-in Windows encryption, they may not be available after changing the Windows password using this method. Exercise caution if you have important encrypted files.
You’ll need a Ubuntu 9.10 Live CD, or a bootable Ubuntu 9.10 Flash Drive. If you don’t have one, or have forgotten how to boot from the flash drive, check out our article on creating a bootable Ubuntu  flash drive.
The program that lets us manipulate Windows passwords is called chntpw. The steps to install it are different in 32-bit and 64-bit versions of Ubuntu.
Installation: 32-bit
Open up Synaptic Package Manager by clicking on System at the top of the screen, expanding the Administration section, and clicking on Synaptic Package Manager.
sshot-1
chntpw is found in the universe repository. Repositories are a way for Ubuntu to group software together so that users are able to choose if they want to use only completely open source software maintained by Ubuntu developers, or branch out and use software with different licenses and maintainers.
To enable software from the universe repository, click on Settings > Repositories in the Synaptic window.
Add a checkmark beside the box labeled “Community-maintained Open Source software (universe)” and then click close.
When you change the repositories you are selecting software from, you have to reload the list of available software. In the main Synaptic window, click on the Reload button.
The software lists will be downloaded.
Once downloaded, Synaptic must rebuild its search index. The label over the text field by the Search button will read “Rebuilding search index.” When it reads “Quick search,” type chntpw in the text field. The package will show up in the list.
Click on the checkbox near the chntpw name. Click on Mark for Installation.
chntpw won’t actually be installed until you apply the changes you’ve made, so click on the Apply button in the Synaptic window now.
You will be prompted to accept the changes. Click Apply.
The changes should be applied quickly. When they’re done, click Close.
chntpw is now installed! You can close Synaptic Package Manager. Skip to the section titled Using chntpw to reset your password.
Installation: 64-bit
The version of chntpw available in Ubuntu’s universe repository will not work properly on a 64-bit machine. Fortunately, a patched version exists in Debian’s Unstable branch, so let’s download it from there and install it manually.
Open Firefox. Whether it’s your preferred browser or not, it’s very readily accessible in the Ubuntu Live CD environment, so it will be the easiest to use. There’s a shortcut to Firefox in the top panel.
Navigate to http://packages.debian.org/sid/amd64/chntpw/download and download the latest version of chntpw for 64-bit machines.
Note: In most cases it would be best to add the Debian Unstable branch to a package manager, but since the Live CD environment will revert to its original state once you reboot, it’ll be faster to just download the .deb file.
Save the .deb file to the default location.
You can close Firefox if desired. Open a terminal window by clicking on Applications at the top-left of the screen, expanding the Accessories folder, and clicking on Terminal.
In the terminal window, enter the following text, hitting enter after each line:
cd Downloads
sudo dpkg –i chntpw*
chntpw will now be installed.
Using chntpw to reset your password
Before running chntpw, you will have to mount the hard drive that contains your Windows installation. In most cases, Ubuntu 9.10 makes this simple.
Click on Places at the top-left of the screen. If your Windows drive is easily identifiable – usually by its size – then left click on it.
If it is not obvious, then click on Computer and check out each hard drive until you find the correct one.
The correct hard drive will have the WINDOWS folder in it. When you find it, make a note of the drive’s label that appears in the menu bar of the file browser.
If you don’t already have one open, start a terminal window by going to Applications > Accessories > Terminal.
In the terminal window, enter the commands
cd /media
ls
pressing enter after each line. You should see one or more strings of text appear; one of those strings should correspond with the string that appeared in the title bar of the file browser earlier.
Change to that directory by entering the command
cd <hard drive label>
Since the hard drive label will be very annoying to type in, you can use a shortcut by typing in the first few letters or numbers of the drive label (capitalization matters) and pressing the Tab key. It will automatically complete the rest of the string (if those first few letters or numbers are unique).
We want to switch to a certain Windows directory. Enter the command:
cd WINDOWS/system32/config/
Again, you can use tab-completion to speed up entering this command.
To change or reset the administrator password, enter:
sudo chntpw SAM
SAM is the file that contains your Windows registry. You will see some text appear, including a list of all of the users on your system.
At the bottom of the terminal window, you should see a prompt that begins with “User Edit Menu:” and offers four choices. We recommend that you clear the password to blank (you can always set a new password in Windows once you log in). To do this, enter “1” and then “y” to confirm.
If you would like to change the password instead, enter “2”, then your desired password, and finally “y” to confirm.
If you would like to reset or change the password of a user other than the administrator, enter:
sudo chntpw –u <username> SAM
From here, you can follow the same steps as before: enter “1” to reset the password to blank, or “2” to change it to a value you provide.
And that’s it!
Conclusion
chntpw is a very useful utility provided for free by the open source community. It may make you think twice about how secure the Windows login system is, but knowing how to use chntpw can save your tail if your memory fails you two or eight times!

Become a Linux Terminal Power User With These 8 Tricks

bash tricks header
There’s more to using the Linux terminal than just typing commands into it. Learn these basic tricks and you’ll be well on your way to mastering the Bash shell, used by default on most Linux distributions.
This one’s for the less experienced users – I’m sure that many of you advanced users out there already know all these tricks. Still, take a look – maybe there’s something you missed along the way.

Tab Completion

Tab completion is an essential trick. It’s a great time saver and it’s also useful if you’re not sure of a file or command’s exact name.
For example, let’s say you have a file named “really long file name” in the current directory and you want to delete it. You could type the entire file name, but you’d have to escape the space characters properly (in other words, add the \ character before each space) and might make a mistake. If you type rm r and press Tab, Bash will automatically fill the file’s name in for you.
Of course, if you have multiple files in the current directory that begin with the letter r, Bash won’t know which one you want. Let’s say you have another file named “really very long file name” in the current directory. When you hit Tab, Bash will fill in the “really\ “ part, since the files both begin with that. After it does, press Tab again and you’ll see a list of matching file names.

Continue typing your desired file name and press Tab. In this case, we can type an “l” and press Tab again and Bash will fill in our desired file name.
This also works with commands. Not sure what command you want, but know it begins with “gnome”? Type “gnome” and press Tab to see a list.

Pipes

Pipes allow you to send the output of a command to another command. In the UNIX philosophy, each program is a small utility that do one thing well. For example, the ls command lists the files in the current directory and the grep command searches its input for a specified term.
Combine these with pipes (the | character) and you can search for a file in the current directory. The following command searches for the word “word”:
ls | grep word

Wild Cards

The * character – that is, the asterisk – is a wild card that can match anything. For example, if we wanted to delete both “really long file name” and “really very long file name” from the current directory, we could run the following command:
rm really*name
This command deletes all files with file names beginning with “really” and ending with “name.” If you ran rm * instead, you’d delete every file in the current directory, so be careful.

Output Redirection

The > character redirects a command’s output to a file instead of another command. For example, the following line runs the ls command to list the files in the current directory and, instead of printing that list to the terminal, it prints the list to a file named “file1” in the current directory:
ls > file1

Command History

Bash remembers a history of the commands you type into it. You can use the up and down arrow keys to scroll through commands you’ve recently used. The history command prints a list of these commands, so you can pipe it to grep to search for commands you’ve used recently.

~, . & ..

The ~ character – also known as the tilde – represents the current user’s home directory. So, instead of typing cd /home/name to go to your home directory, you can type cd ~ instead. This also works with relative paths – cd ~/Desktop would switch to the current user’s desktop.
Similarly, the . represents the current directory and the .. represents the directory above the current directory. So, cd .. goes up a directory. These also work with relative paths – if you’re in your Desktop folder and want to go to the Documents folder, which is in the same directory as the Desktop folder, you can use the cd ../Documents command.

Run a Command in the Background

By default, Bash executes every command you run in the current terminal. That’s normally fine, but what if you want to launch an application and continue using the terminal? If you type firefox to launch Firefox, Firefox will take over your terminal and display error messages and other output until you close it. Add the & operator to the end of the command to have Bash execute the program in the background:
firefox &

Conditional Execution

You can also have Bash run two commands, one after another. The second command will only execute if the first command completed successfully. To do this, put both commands on the same line, separated by a &&, or double ampersand.
For example, the sleep command takes a value in seconds, counts down, and completes successfully. It’s useless alone, but you can use it to run another command after a delay. The following command will wait five seconds, then launch the gnome-screenshot tool:
sleep 5 && gnome-screenshot

Do you have any more tricks to share? Leave a comment and help your fellow readers!

3 Easy Ways to Connect to Windows Shared Folders from Linux

Connecting to file servers is something most people do on a daily basis even without thinking about it. In Linux, it may not be intuitive how to quickly connect to a samba or ftp server without a separate program. Here are a few different ways to connect to a remote file server without needing to touch a terminal.

Using Keyboard Shortcut

You can connect to a server by opening the run application window with the Alt+F2 keyboard shortcut. You will just need to specify the server type by adding the protocol at the beginning of the command. For example smb:// will connect to a samba share; other supported protocols are ssh, ftp, sftp, http, and https.
Note: In the example below my server name is playground and the shared folder is called music.
If your server requires a password to connect, fill out the next window that pops up and select how long you would like it to store your password.
A Nautilus window will automatically open with the server you just connected to, and you should have a shortcut under places on the left side and a shortcut on your desktop.

From GNOME Menu

If you are using Ubuntu, and many other GNOME based distributions, you will have a places menu on your top menu bar. Open that menu and click connect to server.
A new window will open up with a drop down so you can select what type of server you are connecting to.
For a samba/cifs server select Windows share and fill out the required information.
Note: Unlike the run application window, you do not need the slashes to connect here.
Alternatively, you can also get to the connect to server window from Nautilus’ file menu.

With a Shortcut

If you would like instant access to the connect to server window from your GNOME menu bar right click on the menu you would like to add the shortcut to and click add to panel.
In the window that pops up, search for “connect” and connect to server should be one of the results. Highlight the shortcut and click add at the bottom of the window.
Now you will have an additional shortcut on your GNOME bar for easy access.

Thursday, 5 April 2012

Linux Mint 12

Linux Mint 12, as you may have heard, uses GNOME 3.2 as its desktop environment. But the Linux Mint developers never do anything quite the same as other distros. In this release they’ve added MGSE (Mint GNOME Shell Extensions) that make it possible to use the GNOME 3 desktop in a way similar to previous releases of GNOME.
Welcome Menu
Welcome Menu
MGSE makes GNOME 3 much, much better than it would be otherwise. In fact, I actually found myself liking GNOME 3 in Linux Mint 12 where I more or less despised it while using Fedora 16.
Do you want to know what my initial reaction was to GNOME 3 in Fedora 16? Remember that scene in Spinal Tap where they are talking about one of Spinal Tap’s albums called “Shark Sandwich” and the film’s narrator mentions that a reviewer published a two-word review simply called “Shit Sandwich.” Well that’s how I felt about GNOME 3; it was a shit sandwich until the Linux Mint developers got their hands on it.
Applications Menu
Applications Menu on Bottom Panel
MGSE basically gives you a bottom panel, an application menu, a window list, tray icons and a desktop that is geared toward tasks instead of application switching. And yes, you can minimize applications to the bottom panel if you want.
In short, you get all of the good technology that underpins GNOME 3 without being stuck in the awful desktop choices of the GNOME developers. The Linux Mint developers have essentially done the unthinkable. They’ve made GNOME 3 enjoyable to use.
What’s New
Here’s a sample of what’s new in this release:
Linux 3.0
Ubuntu 11.10
GNOME 3.2
MGSE (Mint Gnome Shell Extensions)
MATE (a fork of GNOME 2)
Artwork improvements
New backgrounds
Search engine changes
I covered some of the MGSE stuff above, but one thing to remember is that if you are a masochist and want a “pure GNOME 3 experience” then you can easily turn off all the MGSE stuff. So bear that in mind if you find yourself turned off by using MGSE. I cannot imagine a single user who will want to do this, but there are always weird people out there so you never know.
:blink: :wink:
GNOME 3 Applications
GNOME 3 Applications
MATE is a GNOME 2 that lets you keep both versions of GNOME on the same system. The LM developers note that it’s not completely stable yet in the release notes.
Mint-Z is a new theme that is included in Linux Mint 12. It’s based on Zukitwo and Mint-X. New backgrounds include some pretty photos from Yellowstone National Park and India.
GNOME 3 Menu
GNOME 3 Menu
The search engine changes are very interesting. Duck Duck Go is the default search engine now. The LM developers are attempting to use search engines to help fund the Linux Mint project. I think this is a good idea on their part. I’m sure there are significant costs associated with maintaining and developing Linux Mint, so I’m quite happy if my searches go to help fund the project on an ongoing basis.
System Requirements
Here’s what you’ll need to run this update:
  • x86 processor (Linux Mint 64-bit requires a 64-bit processor. Linux Mint 32-bit works on both 32-bit and 64-bit processors).
  • 512 MB RAM (1GB recommended for a comfortable usage).
  • 5 GB of disk space
  • Graphics card capable of 800×600 resolution
  • CD/DVD drive or USB port
Linux Mint 12 Install
One that really pleased me with Linux Mint 12 is that it runs in VirtualBox with no configuration headaches to get GNOME 3 to run. Compare that to Fedora 16, which is a pain in the ass to deal with since you have to work to get GNOME 3.2 to actually load.
Note though that if you boot into the live desktop in VirtualBox you will see the fall back desktop (not the GNOME 3.2). Don’t let that bother you, just do the install and make sure that your virtual machine has 3D set to on. When you boot into your installed desktop, GNOME 3 should load without a problem.
Install 1
Install 1
Install 2
Install 2
Install 3
Install 3
The install is as easy as usual, and it should not be a problem even if you’re a Linux beginner.
–~~~~~~~~~~~~–
Software
Here’s a peek at some of the software that comes with Linux Mint 12:
GIMP
LibreOffice
Firefox
Transmission
Thunderbird
Pidgin IM
Banshee
VLC
Brasero
The default software selection hits all the sweet spots in terms of desktop functionality. There’s obviously quite a bit more software available in the Linux Mint Software Manager, so browse around to find more stuff.
Software Manager
Software Manager
Using Linux Mint 12
Linux Mint 12 is now my default Linux distro. That should tell you a lot about how much I enjoyed using it, compared to Fedora 16 or generic Ubuntu 11.10.
Somehow the Linux Mint developers did it again. They identified the problems with GNOME 3 and then fixed them. They turned a shit sandwich into a delicious, seven course meal that one can savor without a hint of the disgust felt while using GNOME 3 in other distros.
Linux Mint 12 Desktop
Linux Mint 12 Desktop
Final Thoughts
There’s been a lot of talk about Linux Mint catching up to and surpassing Ubuntu in terms of the number of users it has. Well Linux Mint 12 might just be the straw that breaks Ubuntu’s back. While I found Unity slightly more tolerable in Ubuntu 11.10, Linux Mint’s implementation of GNOME 3 blows Unity right off the map and it sets THE standard for GNOME 3 implementations in all distros.
Frankly, the GNOME developers themselves ought to take a look at what the Linux Mint developers have done and make it standard in all GNOME 3 desktops.
Hats off to the Linux Mint developers, again. My stomach has been tied up in knots wondering how they would deal with GNOME 3 and now I can just relax and enjoy Linux Mint again. Linux Mint 12 is really that good.
What’s your take on this distro? Tell me in the comments. For full distro reviews, visit Desktop Linux Reviews.