Thursday, August 21, 2014

Reset Root Password on CentOS 5 & 6


1.

Boot or Reboot your CentOS installation

From the console ATL+CTRL+DEL will get you headed in the right direction.
F57490026cf21a99672045b53f182186ebe80e6cc0620e629e770c2641c977e3_ctrl_alt_del_big
2.

Press Any Key

After the installation reboots, it will come up to a boot countdown. Here, you can press any key, I don't have one either, but any other key works also.
This will bring you to the GRUB menu.
3452f8db7203304f8748f2079e098420af95d7e2d8cc3cbb8ca67236c8b31082_pressanykey_big
3.

GRUB Menu

From the GRUB menu, select the appropriate kernel version and press the 'e' key.
You will now be presented with the option menu for the kernel version.
39242d989527920187c0e7c6a631c66a57241b7c73e0e6622c5d462d63e47cc9_grubmenu_big
4.

Kernel Options Menu

From this menu, select the kernel /vmlinuz-... line and press the 'e' key.
You will now be presented with the kernel boot options.
B06e65d5bfe0431b221da2d5a6b7627a8588bd2bbcaf1e79dfd7182d344e1773_kerneloptionsmenu_big
5.

Change Kernel Boot Options

Now we need to add to the end of this line one o the following:
1, s, or single
And now press Enter to save your changes.
C24410ec089f7ad524023f91ceb66454e932d562ca3d68602b63affecf253f8f_kernelbootoptionsmenu_big
6.

Boot your temporary options

From this menu, you should already be on the kernel /vmlinuz... line.
Press the 'b' key to boot to these temporary options to allow you to recover your root account.
2976ddc77f756bc795e082b3d553afccb63a95d5f419147d72575a7f9b4c4b85_kerneloptionsmenu_big
7.

Set Root Password

Now you will boot up to the root shell and you can use passwd to set your new password.
You will be required to enter the password twice.
Once you have completed this, reboot and you have a new root password for your CentOS installation.
1d2eb3ca440800d668e5123c8e2ece81de11aa565aa6aeb1f17d11afb3be8703_passwd_big

Wednesday, August 20, 2014

Enable EPEL Repo on CentOS 5 and CentOS 6


What is the EPEL repo?

The EPEL (Extra Packages for Enterprise Linux) yum repository is an excellent source for additional packages for CentOS. Instead of having to compile applications that aren’t included in CentOS’ built-in repositories from source, EPEL can be used.
The EPEL repo is enabled by simply installing an RPM. Please use the command below to install the EPEL repository on your CentOS server. If you are unsure of your CentOS version or architecture, 
The following will help you to determine the version and architecture of your CentOS server:

To find your CentOS version and architecture, you can use the following easy commands.

1. Quick and easy command to show what version and architecture your CentOS server is running:

$ echo "I am running: `cat /etc/redhat-release` (`arch`)"
I am running: CentOS release 5.8 (Final) (x86_64)

 2. Show CentOS version using /etc/issue:

$ cat /etc/issue
CentOS release 5.8 (Final)

 3. Show CentOS version using /etc/redhat-release:

$ cat /etc/redhat-release
CentOS release 5.8 (Final)

 4. Show CentOS architecture using the arch command:

$ arch
x86_64

 5. Show runnel kernel version and architecture with the uname command:

$ uname -r -v -p
2.6.18-308.el5.028stab099.3 #1 SMP Wed Mar 7 15:56:00 MSK 2012 x86_64

CentOS 6 – 32-bit

 CentOS 6 – 64-bit

 CentOS 5 – 32-bit

 CentOS 5 – 64-bit

After running the above commands for your relevant CentOS version, the following file is created:
/etc/yum.repos.d/epel.repo
The above file can be edited directly to enable or disable the EPEL repo.