bash: ulimit: core file size: cannot modify limit: Operation not permitted

Solution 1:

Grep for a hard limit setting in your bash initialization files. From the bash man page.

A hard limit cannot be increased once it is set; a soft limit may be increased up to the value of the hard limit.

The hard limit is set via the ulimit -H flag. It may be set in /etc/bash* or /etc/profile* files. Look for a ulimit -Hc setting.

Solution 2:

I had this happen to me when I used dropbear as an SSH server. Apparently, dropbear sets some hard limits before spawning your shell.

Switching to OpenSSH solved the problem.