View Single Post
  #5   (View Single Post)  
Old 13th December 2008
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

Quote:
Originally Posted by Mantazz
If I connect to the database as root, I can see the table and columns correctly. Obviously this is not a good practice so I then made a database account "syslog" and gave it permissions accordingly:
Code:
grant all on hackers to syslog@localhost identified by 'PASSWORD';
You should never give all privileges to users that don't actually require them!

Instead of giving a user all privileges, give him only the privileges that he needs. In fact you will only need the SELECT and INSERT privileges, but if you want to delete or update some data (remove old entries for example) from the database you can add the DELETE and UPDATE privileges.
Quote:
Originally Posted by Mantazz
Looks like the problem was that it was permissions for tables, not databases. In this case, the database was called "hackers" and the table was called "attempts".
AFAIK, there may be no mechanism to grant permissions for entire databases, only for tables within.
Actually there is a way and I suggest you that you create your database this way - giving the user syslog minimum privileges:

Code:
GRANT SELECT, INSERT, DELETE, UPDATE 
ON hackers.*
TO 'syslog'@'localhost'
IDENTIFIED BY 'somepassword';
Note the way you give permissions to the entire database - the second row, note the .* after the name of the database.

You can have a look at the MySQL documentation for more information about the GRANT syntax and the different levels of privileges
http://dev.mysql.com/doc/refman/5.1/en/grant.html

Also to reduce the number of hackers trying to get into your box via SSH, you could change the port number SSH is listening to - for example some high port number.
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote