This post is mainly for my own benefit since I lost track of the steps I followed to change the mysql default password in a Centos 7 environment.
I am going to assume that you can use yum to install the mysql-community sever just fine.
The default root password is actually stored in the mysql log.
Follow the steps below:
[abasu@localhost Documents]$ grep root@localhost /var/log/mysqld.log
2018-01-16T02:56:47.029538Z 1 [Note] A temporary password is generated for root@localhost: C9*=ntep#SPk
[abasu@localhost Documents]$ mysql -u root -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.7.21
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> alter user ‘root’@’localhost’ identified by ‘Passw0rd!’;
Query OK, 0 rows affected (0.10 sec)
OK, in this Steganography challenge today, I have used one of my favorite dishes – chicken curry. This image was taken in 2013 in Bluefield VA at my house. I have hidden another full image inside the chicken curry! See if you could solve and extract the image. You should try this dish for a blind date!
MD5 hash of the hidden image is : 99860294e16ee4444b8edc407e6dae1b
CTF lovers, I have hidden a secret message with the image of a “tree turtle” I took almost a decade ago. See if you can solve the problem. The secret message starts with “Secret”. Now, just play some Hide and Seek!
We can update default password policy in Linux as well:
# Configuration for systemwide password quality limits
# Number of characters in the new password that must not be present in the
# old password.
# difok = 1
# Minimum acceptable size for the new password (plus one if
# credits are not disabled which is the default). (See pam_cracklib manual.)
# Cannot be set to lower value than 6.
# minlen = 8
# The maximum credit for having digits in the new password. If less than 0
# it is the minimum number of digits in the new password.
# dcredit = 0
# The maximum credit for having uppercase characters in the new password.
# If less than 0 it is the minimum number of uppercase characters in the new
# ucredit = 0
# The maximum credit for having lowercase characters in the new password.
# If less than 0 it is the minimum number of lowercase characters in the new
# lcredit = 0
# The maximum credit for having other characters in the new password.
# If less than 0 it is the minimum number of other characters in the new
# ocredit = 0
# The minimum number of required classes of characters for the new
# password (digits, uppercase, lowercase, others).
# minclass = 0
# The maximum number of allowed consecutive same characters in the new password.
# The check is disabled if the value is 0.
# maxrepeat = 0
# create a new user
sudo adduser wonderfulperson
sudo useradd wonderfulperson
# udpate password
sudo password wonderfulperson
# batch add users.
# add the test content below
# username:passwd:uid:gid:full name:home_dir:shell
# back to shell, type the newusers command with attribute
sudo newusers users.txt
?? $ less /etc/passwd | grep user
# look up all of the existing groups in Linux
cut -d: -f1 /etc/group
# To review which group a user belong to use:
# Add groups
sudo groupadd guestusers
sudo addgroup guestusers
# To add one user in multiple groups user the following code:
sudo usermod -a -G <group1>,<group2>,<group3> <username>
?? $ sudo usermod -a -G mysql,apache,sssd user2
?? $ groups user2
user2 : user2 sssd apache mysql