How to fix the «chdir(): Permission denied» issue on a Composer command?

The cause on this issue is running a Magento 2 Composer command by a wrong operating system account.
You should run the Composer command by the same user which owns Magento 2 installation folder.