LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-25-2014, 10:24 PM   #1
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 332

Rep: Reputation: 3
Changed root name for MySQL. Lynis gives warning. Should I worry?


I have installed LAMP on Debian 7.0 and have changed the MySQL root name to something else to enhance security. Lynis consequently gives a warning

Code:
No MySQL root password set [DBS-1816]
I can log into MySQL as root without a password but cannot do anything once I am in that way because the user "root" is no longer in the name table. If I enter

Code:
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('trickyPassword');
I get

Code:
ERROR 1133 (42000): Can't find any matching row in the user table
Should I just ignore the lynis warning?
 
Old 06-26-2014, 08:50 AM   #2
Ook
Member
 
Registered: Apr 2004
Location: Hell, Arizona (July - 118 degrees)
Distribution: Slackware 14.2 soon to be Slackware 15
Posts: 699

Rep: Reputation: 131Reputation: 131
Is there an entry in the user table where user='root' and host = 'localhost'? Check it and see. There can be several root entries, and there might not be one with localhost as the host;

use mysql;
select user,host from user;


That will display all of the entries in the user table, you want to see if there is a line like this:
+----------------+----------+
| host | user |
+----------------+----------+
....
| localhost | root |

If not, then see what root entries do exist and with what host. Those are the ones you want to use to set the password. Or maybe you want to get rid of them and create a root@localhost entry. It depends on how you want your root account accessed.
 
Old 06-26-2014, 08:20 PM   #3
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 332

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by Ook View Post
Is there an entry in the user table where user='root' and host = 'localhost'? Check it and see. There can be several root entries, and there might not be one with localhost as the host;

use mysql;
select user,host from user;


That will display all of the entries in the user table, you want to see if there is a line like this:
+----------------+----------+
| host | user |
+----------------+----------+
....
| localhost | root |

If not, then see what root entries do exist and with what host. Those are the ones you want to use to set the password. Or maybe you want to get rid of them and create a root@localhost entry. It depends on how you want your root account accessed.
Quote:
Code:
use mysql;
The password-free login as 'root' will not even let me do that.

Code:
$ mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 56
Server version: 5.5.37-0+wheezy1 (Debian)

Copyright (c) 2000, 2014, 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
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
mysql>
I changed the root name for security reasons. The way that I did it is outlined here.

Thanks,
OH
 
Old 06-26-2014, 08:33 PM   #4
Ook
Member
 
Registered: Apr 2004
Location: Hell, Arizona (July - 118 degrees)
Distribution: Slackware 14.2 soon to be Slackware 15
Posts: 699

Rep: Reputation: 131Reputation: 131
If I understand what that link is saying, you changed the root user name to admin? Did you try logging in as "admin"?
 
Old 06-26-2014, 08:40 PM   #5
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 332

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by Ook View Post
If I understand what that link is saying, you changed the root user name to admin? Did you try logging in as "admin"?
"Admin" was used there as an example. I changed the root user name to a secret name that I can log in as. I'm just wondering if I should ignore the Lynis warning.

Thanks,
OH
 
Old 06-26-2014, 09:11 PM   #6
Ook
Member
 
Registered: Apr 2004
Location: Hell, Arizona (July - 118 degrees)
Distribution: Slackware 14.2 soon to be Slackware 15
Posts: 699

Rep: Reputation: 131Reputation: 131
Well, in a real world production system, you would not do this. Root is root, and you secure it instead of renaming it. But it's your server so do what you want.

To answer your question - if the root account has no privileges, then ignore the warning.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changed my root user access for mysql access to Any from localhost SSBN Linux - Server 2 03-14-2011 02:25 PM
Warning: Remote Host Identification Has Changed! yogesh619 Linux - Newbie 1 08-21-2008 08:41 AM
Warning: Remote Host Identification Has Changed! xpucto Linux - Security 1 02-21-2008 03:37 AM
Warning: Remote Host Identification Has Changed! kkeith Linux - Newbie 1 08-24-2006 01:13 AM
Big problem changed root password for mysql can't login pls comment johnnydangerous Linux - Software 5 07-08-2005 01:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration