The simple procedure explained below will hopefully sort out all your woes!!
First of all, you will require a Linux live CD (like the Ubuntu Live CD or my favourite 'Knoppix' CD. (download it free from here!!!). You can also use the convinient bootable Linux USB pendrives too.
A long list of available (for free!!) Linux Live CD can be found here!!
"A live CD or live DVD is a CD or DVD containing a bootable computer operating system. Live CDs are unique in that they have the ability to run a complete, modern operating system on a computer lacking mutable secondary storage, such as a hard disk drive. Live USB flash drives are similar to live CDs, but often have the added functionality of automatically and transparently writing changes back to their bootable medium. The term "live" derives from the fact that these CDs each contain a complete, functioning and operational operating system on the distribution medium. While a live CD typically does not alter the operating system or files already installed on a computer's hard drive, many live CDs include mechanisms and utilities for altering the host computer's hard drive, including permanent installation. This is important for the system management aspect of live CDs, such as removing viruses, drive imaging, and system recovery." - from wikipediaYou will recreate a user that has administrative permissions on your server as mentioned below.
- Boot from a rescue CD such as a Knoppix Live CD or bootable pen-drive. It doesn't really matter what you use, as long as you can boot Linux and get access to a shell prompt. Make sure to mount the /dev and /proc directories and establish a chroot environment that points to your server's root directory.
- You are now root on your server's file system. Use the passwd command to reset the password for the user root. From now on, you have re-established access to the root account.
- Reboot your server without the Knoppix CD and verify that you can log in as root, using the password that you've just set.
- Recreate an administrative user account that is not root. If for example the name of this user account is Gunz, use
useradd -m gunz
. To use sudo to execute commands as root, you must make sure that the user account is a member of the group adm. To make a user with the name gunz member of the group adm, useusermod -G adm gunz
. - Use
passwd gunz
to give the user you've just created a password. You have now re-established a user account that can be used to perform administration tasks on your server.
No comments:
Post a Comment