altair4 wrote: ⤴Fri Jan 04, 2019 8:13 am
This part I don't quite understand. Your credentials file is in
/etc/cifspwd
so all users would be using the same credentials. Am I missing something?
No wonder that location of the password file attracts your attention. Since /etc/fstab is not user specific, logically any user's password file should not be in any user's home directory, therefore I put it in /etc/. However, since it contains a specific user's credentials, maybe it should be in that specific users /home dir anyway, where it can be encrypted (if encryption was enabled during install). What a dilemma
I have tried placing it in the user's home dir, in which case the drives are not mapped/mounted automatically during boot. So we're back to using the noauto option, perhaps with the password file in the users home dir, but since the user has to execute a mount command upon every logon, then the only thing achieved is not having to use SUDO.
I have tried something else. In /etc/fstab, I just tried adding:
uid=/home/$USER/uid.txt,gid=/home/$USER/uid.txt
...hoping it would provide a way for a per-user uid file, specifying a username, but I get an error, ie the $USER does not resolve to the username of the user attemting "mount -a". It also seems fstab only accepts a username, not a file to look up the username in. So this was a dead end. Besides, if the crendentialsfile is encrypted, it may not work anyway.
This leaves me with autofs.
I have set it up and it works perfect.
I found several different web sites with their own description of how to configure autofs, but the one you linked to, worked like a charm. Thumbs up!
The only thing that cheated me, was not having RW access to the files, despite having had that, when mounting with fstab or via a mount command in terminal. I realized that uid=1234 and gid=1234 in autofs are for the local users, not for users on the samba server.