password

All posts tagged password

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

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 ;).