# How To: Mount SMB Shares on a Pi

[https://linuxize.com/post/how-to-mount-cifs-windows-share-on-linux/](https://linuxize.com/post/how-to-mount-cifs-windows-share-on-linux/)

tl;dr (assuming user/share is set up on freenas)

1\. Install cifs-utils and create your mount directory  
  
2\. Create a credentials file */etc/win-credentials-app*   
3\. Populate with *username=* and *password=* on two lines in plaintext (scary, I know)  
  
4\. Chown root: and chmod 600 to have a thin veil of security  
  
5\. One-off mount:  
**sudo mount -t cifs -o credentials=/etc/win-credentials-app,dirmode=0755,uid=1000,gid=1000 //freenas.lan/app /app** *Replace win-credentials-app with your credentials file and 1000/1000 with your user's user/group IDs.*

6\. Auto-mount: (add to /etc/fstab)  
**//freenas.lan/app /app cifs credentials=/etc/win-credentials-app,file\_mode=0755,uid=1000,gid=1000 0 0**  
  
7\. Will mount automatically on boot. Use *sudo mount /app* or *sudo umount /app* to manually mount/unmount with an fstab entry.