Forgotten password in Linux

It happens to me every so often, that I have to do maintenance on a Linux box, and I’ve changed my passwords around and can’t remember the password I used on that particular box (or even the user name…). I always have to hunt around the net, hoping I find something, so I thought I’d capture it on my own blog:

  1. Reboot the computer
  2. At the GRUB or LILO prompt, press escape.
  3. Go to the line that would normally boot, and press e to edit
  4. Go to the end of the command line, and add rw init=/bin/bash to it
  5. Press Enter, then press b to boot
  6. You should now be entered into a passwordless root shell
  7. Either set your password with passwd <username>, or see a list of users with cat /etc/passwd.
  8. Reboot again
  9. Happy times!

Hope this helps me (and maybe some else) in the future…

Ubuntu and the Symantec Backup client

At our company we’re using Symantec Backup Exec to back up all our servers, including some Linux machines. I set up a newer Ubuntu install (9.04) on VMWare, and was pretty confident I would be able to get the backup working (using the Legacy agent). Well, that was not as easy as it seemed…

I followed the instructions on installing the legacy agent. After some tweaking here and there, the server was now showing up in the list of legacy agents on the Backup Exec server. However, every time I tried to pull up information on the server, Backup Exec returned an error, saying the server refused connections and may be running out of available network connections. Nonsense. But something was not right apparently.

Googling around for instructions, and suspecting a firewall or security setting, I tried tweaking access to the ports Backup Exec is using. No effect. Then I hit upon something: luckily I had an older Ubuntu server running with the legacy Backup Exec client, and could compare settings. It turns out that Ubuntu installs a host file with the following content:

127.0.0.1 localhost
127.0.1.1 fqdn.domain.com fqdn

Why is there a difference in the third tuple? On the older server, both lines referred to 127.0.0.1. I decided to change the 2nd line on the newer server to 127.0.0.1 and reboot. After giving everything some time to publicize itself on the network, it appeared and asked for the credentials to use for the new server. I selected the correct user, and to my astonishment, the complete directory structure appeared.

I don’t know why there are two different entries for the local machine, but it definitely broke the legacy Backup Exec client. Now I can only hope I never have use our backups…!

Firefox equivalent of Internet Explorer’s Every Time I visit the Web page

We have a little rotating web page setup in our break room, and have been using a dial indicator to show our performance in bookings and shipments. However, due to the nature of the set-up (a page, showing a flash file, that is configured by an XML file), it turned out to be necessary in Internet Explorer to use the option “Every time I visit the webpage” on the “Check for newer versions of stored pages:” setting in the Temporary Internet Files and History Settings.

Unfortunately, Internet Explorer 7 still can’t handle CSS properly, so some of the tables looked horrible. Switching to Firefox fixed that problem. But now the old data was showing. And where is that “Newer versions of stored pages” setting in Firefox???

It’s hiding in the config. In the address bar, type

about:config

Then find the setting browser.cache.check_doc_frequency, and change it to 1. This will duplicate the Internet Explorer behavior (as far as loading cached page goes, mind you!).

The options for this setting are as follows:

ValueDescription
0Check for a new version of a page once per session
1Check for a new version every time a page is loaded
2Never check for a new version – always load the page from cache
3Check for a new version when the page is out of date (Default)

Nagios – how to determine the name of a service in Windows

I’ve recently set up Nagios on one of our test servers, and the Windows client for Nagios allows you to monitor services (whether they started, stopped, etc.). However, the name of the service to monitor isn’t always the same as the name in the Services application in Administrative Tools.

To find out the name of the service, you’ll have to look at the registry:

  1. Open up regedit (Run, regedit)
  2. Navigate to HKEY_LOCAL_MACHINE
  3. Navigate to SYSTEM
  4. Navigate to CurrentControlSet
  5. Navigate to Services
  6. Find the service you plan on monitoring. The name of the node is the name you need to enter on the Nagios server as the name of the service.

Upgrade Ubuntu server 6.04 LTS to 8.04 LTS

When upgrading an Ubuntu server to 8.04 LTS, you should use the new and improved server upgrade system. Use the following steps to activate this upgrade process:

  1. Enable the “dapper-updates” repository
  2. Install the “update-manager-core” package. Dependencies include python-apt, python-gnupginterface and python2.4-apt.
  3. Run the command “sudo do-release-upgrade” in a terminal window
  4. Follow the prompts on-screen.

, , , , , , , ,