In a previous How To I showed you how to share a folder on a windows network. Today I will detail how to setup a password on that folder. If you havent shared a folder already and installed SAMBA, then head to my other How To.

  1. First open terminal on your Raspberry Pi
  2. We will need to greate a group for the samba users run the command sudo addgroup privateshares
  3. Next create a user by running the command sudo useradd tech -G privateshares , This will create a user named “tech” and add them to the group created earlier
  4. Then set their password by running the command sudo smbpasswd -a tech
  5. You will need to type the password twice for the user
  6. Next run the command sudo leafpad /etc/samba/smb.conf
  7. Find the section you added in the previous tutorial.
  8. [Home]
    comment=Raspberry Pi Share
    only guest=no
    create mask=0777
    directory mask=0777
  9. Add the following to the bottom
  10. valid users = @privateshares
    read only = no
  11. Save and close the text window
  12. Now in windows head to \\<your pi name>\Home
  13. You should be asked for your username and password.