root

All posts tagged root

This short article describe how to reset lost root password on Linux system. IMPORTANT: This method require physical access to the machine.

On GRUB screen select normal boot option:

1Press ‘e’ to edit selected option. You will see short GRUB code.

2

Search for the line starting with “linux /boot/vmlinuz…” or similar depending of Linux distribution. This is the place where kernel and rootfs is selected. Change ‘ro’ option to ‘rw’ and add: Continue Reading

PHPMyAdmin is an useful tool for MySQL database managing. The GUI is well-known and easy to use. It is often used in a shared hosting but an out of the box version has a small disadvantage. It allows root login. We can of course set a complicated password but the problem still exists and someone who stole root’s password can easily manage our whole database server.

Continue Reading

There is a nice trick allowing to change a forgotten root password for MySQL on Debian Linux without database stopping. Just look into this file.

# cat /etc/mysql/debian.cnf 
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = u372tK6cEsTLbz0n
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = u372tK6cEsTLbz0n
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr

Simply login using this credentials and execute the query as follows.

mysql> SET PASSWORD FOR root@localhost = password('new-password');

Debian-sys-maint account was used as a backdoor ;).