I just got a CentOS VPS and was reviewing the passwd file and saw this:
Is bash necessary for mysql?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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.
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/true or any other no-op program would be fine.