Secure your credentials for file share mounts on Ubuntu 17.04
I was in “Just make it work” mode and found I’d left my credentials out in plain text after setting up my Plex server to read off a remote fileshare.
Don’t do that, instead, do this:
-
Create a directory on your local linux machine where you’ll access the file share:
sudo mkdir /media/PlexMedia
-
Modify /etc/fstab and add the following:
//remoteservername/fileshare /media/PlexMedia cifs uid=1000,iocharset=utf8,credentials=/etc/cifs-creds 0 0
-
Now you need to create the credentials file:
sudo touch cifs-creds && sudo chmod 600 cifs-creds
-
Use your favorite editor to modify the newly-created ‘cifs-creds’ file and add the following:
user=YourUser password=YourPassword
-
Reboot, and you’ll auto-mount the file share, securely :)
Read other posts