LinuxQuestions.org
Review your favorite Linux distribution.
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 02-18-2011, 05:18 AM   #1
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 188

Rep: Reputation: 30
Block Access to mysql


Hi,

What's the best way in centos to block a user from accessing mysql. I don't want him to be able to run the mysql command, so just putting passwords up in mysql is not good enough. Mysql is running ad user=mysql, and i added the user in a different group by he is able to access mysql by typing in the command.

How can i block this command being availible for this user.
 
Old 02-18-2011, 07:08 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
You probably just need to change the permissions on the mysql binary so that normal users can't run it. So if you changed mysql to something like 750, only the owner and accounts in the proper group could run it. What are the current permissions on mysql?
 
Old 02-18-2011, 07:41 AM   #3
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 188

Original Poster
Rep: Reputation: 30
Yes,thanks i changed it to 754 now. I just need to make 100% sure i'm not now blocking something that actually needs mysql.

thanks for reply
 
Old 02-18-2011, 08:50 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Quote:
I don't want him to be able to run the mysql command, so just putting passwords up in mysql is not good enough.
What's to stop him from compiling a mysql client and run it from his own home directory? Or simply copy it from a different computer?
 
Old 02-18-2011, 09:17 AM   #5
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
Hrmm...

How about SELinux?

Also, to be honest, if you can't trust this user and want to lock him out of a certain command, you might want to start worrying about what else he may be doing that you aren't currently aware of. Guttorm has a point, too...how far do you want to take it?

Last edited by unixfool; 02-18-2011 at 09:20 AM.
 
Old 02-21-2011, 07:44 PM   #6
nitrogendizzy
LQ Newbie
 
Registered: Feb 2011
Location: >>
Distribution: >>
Posts: 3

Rep: Reputation: Disabled
Quote:
Originally Posted by Guttorm View Post
What's to stop him from compiling a mysql client and run it from his own home directory? Or simply copy it from a different computer?
Trusted Path Execution, RBAC etc, depends if the server is properly configured.

Don't really use MySQL, but couldn't you also bind to socket and change permissions on it too.
Could also RSH the user so can only exec certain commands in a chroot(if they connect via SSH).

Last edited by nitrogendizzy; 02-21-2011 at 07:45 PM.
 
  


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
Block table with Mysql chobong Linux - Server 8 03-01-2010 09:22 PM
how do I block access to websites Glenn D. Linux - Newbie 2 01-27-2010 11:07 PM
How to block access certain services shankarLe Linux - Security 3 07-27-2007 03:35 AM
how to block internet access? E_l_d_o Linux - Networking 2 05-03-2007 12:39 PM
how do you block access to a site? smarthouseguy Slackware 3 05-14-2006 10:09 AM

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

All times are GMT -5. The time now is 10:01 AM.

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