Restrict access to specific folder on samba

You will have to add a new user for that folder with different password ofc.:

Below is an example with user secretuser:

Add user and set password:

useradd secretuser
passwd secretuser

Add samba user:

smbpasswd -a secretuser

Add a user to a Samab share:

[accounts] comment = Accounts data directory
path = /path/to/folder
valid users = user1 user2 secretuser
public = no
writable = yes

Restart the samba:

service smb restart