Hello, I'm setting up a new system that has 2 user accounts
user1 - admin acount
user2 - standard account
I have a NAS with 3 SMB shares set up: Storage, Music, Utilities.
Both users have accounts on the NAS and all permissions are set up in the NAS filesystem (FreeNAS 7).
I want to automount all 3 shares for user1 w/appropriate login/perms, and 2 of the 3 (Storage/Music) for user2.
I installed smbfs, created a .smbcredentials file in each users home folder that looked like:
then added to fstab
//192.168.xxx.xxx/Storage /home/user1/NAS/Storage cifs credentials=/home/user1/.smbcredentials
//192.168.xxx.xxx/Music /home/user1/NAS/Music cifs credentials=/home/user1/.smbcredentials
//192.168.xxx.xxx/Utilities /home/user1/NAS/Utilities cifs credentials=/home/user1/.smbcredentials
//192.168.xxx.xxx/Storage /home/user2/NAS/Storage cifs credentials=/home/user2/.smbcredentials
//192.168.xxx.xxx/Music /home/user2/NAS/Music cifs credentials=/home/user2/.smbcredentials
And while this sort of worked to mount, the permissions were all screwed up and basically showed all the folders and such in the share as being owned by user2, and wouldn't allow user1 access into folders that are actually owned by user1.
I changed fstab with the same 5 entries but ditched using the smbcredentials file...
//192.168.xxx.xxx/Storage /home/user1/NAS/Storage cifs username=user1,password=password,uid=user1,gid=hom egroup 0 0
//192.168.xxx.xxx/Storage /home/user2/NAS/Storage cifs username=user2,password=password,uid=user2,gid=hom egroup 0 0
I set up these users with the same usernames they have on the NAS, added the "homegroup" group to ubuntu with them as members, and added the uid/gid into fstab hoping that would get permisions correct. It works better, but permissions show the group for all folders/files as being user2, which isn't hurting anything, but isn't correct.
My guess is the main problem here is fstab mounts these system wide, and what I'm really trying to do is mount the same shares in different places with different user login info and that's causing some issues. But I've searched around and haven't found any information in setting things up to automount anywhere besides fstab. Is there a file that can be created in a user's home folder that will automount shares just when they login, rather than at boot via fstab?
Any tips would be appreciated. Thanks.