How to stop core dumps being created in /var/crashes?

Once a hard limit is set in /etc/security/limits.conf, the user cannot increase that limit within his own session.

vi /etc/security/limits.conf
hard core 0

This will make sure that core dumps can never be made by setuid programs.

echo ‘fs.suid_dumpable = 0’ >> /etc/sysctl.conf
sysctl -p

Add the following to /etc/profile to set a soft limit to stop the creation of core dump files for all users (which is default and must be disabled):

echo ‘ulimit -S -c 0 > /dev/null 2>&1’ >> /etc/profile