Configuration and Administration articles relating to operating systems, software and anything else tech related. 

This will work for all users although if you know the root password you can reset the user password anyway.

So I was going to use my old PC as a client for my Windows Domain Admin class but first I needed to make sure that I didn't have any files that were important, unlikely since I hadn't used the computer in years, but still need to check.

So I booted up the old PC and realised I couldn't remember the passwords, oops!! After googling for the answer I found this way to reset (really delete) the root password, well any user password since they are all in the same file. BTW this computer is running Slackware Linux 12.2 (probably my favourite Slackware release)

Get a bootable distro that you can copy to disk and boot into a live environment or use one of the many rescue disks out there, I used systemrescueCD which is really nice and easy to use and is quite easy on resources, the PC only has 640Mb of memory, so the newer Ubuntu live CD doesn't run very fast or smooth.

Boot up the CD select an option, there are quite a few, I had to try a couple before I got one that worked, seems that there was a problem booting into a graphical environment, something wrong with the monitor settings (out of sync or refresh error, I forget which) but that doesn't matter since I am happy using the command line. So once booted and at the prompt you need to mount the hard disk (remember this is running off the disk/RAM);

mount -t auto /dev/sda1 /mnt

Then go to the /etc directory

cd /mnt/temp/etc/

Edit the shadow file that holds the password information using your favourite editor such as emacs, vi, pico etc, my editor of choice is emacs

emacs shadow

then what you need to do is locate the line that starts with root, usually the first line, and remove the encrypted password. This is the random assortment of letters between the second and third colons (:), highlighted in red below and just delete it


to leave


Save the file and that's it, just reboot, remembering to remove the CD and when you get to the login screen* just enter root as username and leave the password field empty and BOOM!! access is granted.(see below)

Last thing...remember to set a new root password.

* I couldn't login through the GUI after I had done this I had to reboot using the liveCD and change the runlevel in the inittab file then reboot to the text login and all was well, gave myself a new password and changed the runlevel back to the GUI and rebooted and was able to login as needed.

Remember to add the line

AddType application/x-httpd-php .php

to the httpd.conf file to enable php on apache server (check this after upgrading httpd)

This has caught me out a couple of times!! should really know better by now but how often do you need to change your configs?

Having got hold of a Cisco router I had to try to connect to it via my Windows installed in VirtualBox, problem was the COM port was not recognised in the VirtualBox settings, every time I tried to start windows it failed with an error, one of these errors suggested checking the permissions and user groups to make sure these were correct.

Turns out I needed to add my (host) user to the correct group, use the command
ls -l /dev/ttyS*
to list the current groups for tty's.

As can be seen here the serial ports are all in the dialout group so using the user manager I added myself to the dialout group. Once that was done ( remember to logout and back in once you change group associations!! ) I set up the serial port in the virtualbox settings COM1, choose the Host Device option and add /dev/ttyS0 as the path.

Once this was done I started Windows and it now booted fine and once I was logged in, Windows detected new hardware and installed it.

Now I am able to console into the router and all is good.