Magento2 can be very picky when it comes to file permissions; however the CLI tool that we must use will use the user that is it is run with.

I find using the following format to run the command particularly useful because it lets me run the CLI tool as my magento user.

su -s /bin/sh apache -c "bin/magento cache:flush block_html"