Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I just got a CentOS VPS and was reviewing the passwd file and saw this:

mysql:x:498:499:MySQL server:/var/lib/mysql:/bin/bash

Is bash necessary for mysql?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

The shell may need to be set in some circumstances, for example if you want to initiate jobs remotely over SSH as the mysql user, or through sudo. These aren't common needs. You don't need to have a shell set for cron jobs, /bin/false will do fine.

Giving the mysql user a shell isn't a security hole on its own. The reason it's frowned upon is that compounded with a misconfiguration of some login service, it might allow someone to obtain a shell as mysql. Putting a program that does nothing avoids this — even if an attacker manages to log in as mysql that won't do them any good. It's common to use /bin/false or /usr/sbin/nologin, but /bin/true or any other no-op program would be fine.

share|improve this answer
    
thank you for the help! –  ErocM Sep 29 '12 at 0:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.