7 easy steps to reset root password on CentOS/Red Hat

So you want to became a hacker a reset someone centos root password??

No, this is not for you..it's rather for windows user who happens to administer centos server and forgot his root password. Only 7 simple steps needed...

1. Boot the system and when you see the following message "Press any key to enter the menu", press any key. (You will see the list of available kernel versions.)

2. Press e in order to edit commands before booting.

3. Highlight the list item with vmlinuz in it by using the arrow keys and press e.

4. Now type single OR init 1 at the end of the line.

5. Then press enter and b to boot the system with the new argument. (The system will boot into single user mode and you will see bash prompt)

Now it's time to change the password:
6. Type passwd

### Shell Commands ###
passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
7. Type reboot to restart the system.

There you have it...




Install and Configure MySQL on CentOS

This tutorial covers installing MySQL server and client, as well as some basic configuration to get you up and running.

Install MySQL

Install MySQL service and command line tools.

1 $ yum install mysql mysql-server

Once thats done turn on the MySQL service so that it automatically starts on boot.

1 $ chkconfig --level 2345 mysqld on

Finally start the MySQL service.

1 $ /etc/init.d/mysqld start

Open up MySQL Ports

We are going to open up ports 3306 in iptables.

1 $ vi /etc/sysconfig/iptables

Add the following lines (make sure its above the reject statement).

1 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
2 -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

Restart iptables service for changes to take effect.

1 $ /etc/init.d/iptables restart

MySQL Client

That completes the steps to install mysql, from there you can login in through the client to setup whatever you need to.

1 $ mysql -u root