Can connect to Samba, but access denied to homes

Solution 1:

The solution was this

sudo chcon -t samba_share_t ./data/localdevs/user1

Apparently it's a centos thing.

Note: The syntax as root (replacing with the directory you are trying to share)

chcon -t samba_share_t <share_folder>

Solution 2:

As user893730 implied in his answer, this is caused by SELinux. Importantly, as mentioned by Charles in a comment to the same answer, this might not show up in the audit log.

There is a boolean named samba_enable_home_dirs in the policy that controls whether Samba can share the home directories. Instead of re-labelling the directories with the chcon command, you can set that boolean with the following command:

sudo setsebool -P samba_enable_home_dirs on

The -P option will make the change persistent across reboots.