PDA

View Full Version : [ubuntu] logogn script for Auto mounting windows share script based on user



kumar007
December 23rd, 2012, 06:05 PM
I have a question.
I want to have my desktop Join our AD domain using likewize. After joining domain I want to create a script that will mount user based windows share automatically, and should create a symlink to /home/%user
For example,
Share for domain user1 might look like
//192.168.1.2/user1/ and is redirected from /home/user1 (May be symlink)?
Share for domain user2 might look like this
//192.168.1.2/user2/ and is redirected from /home/user2
Ounce the user logs out, it should unmount the folder.
Thanks in advance.

kumar007
December 24th, 2012, 07:44 PM
No one???
Please help!!!!!!

steeldriver
December 24th, 2012, 07:48 PM
not a script but maybe autofs would do what you want?

https://help.ubuntu.com/community/Autofs

kumar007
December 24th, 2012, 09:08 PM
Thanks for your reply.
I would prefer a script, because this will be deployed for many users who are a part of Active Directory.
Please let me know.

LewisTM
December 25th, 2012, 04:20 AM
I don't think it's possible to use a Windows share as a home folder. Linux needs a UNIX type filesystem that supports permissions and symlinks and whatnot. For network shares that means NFS and perhaps SSHFS, not Samba.

Windows supports "roaming profiles" that resemble NFS homes but involves network syncing to and from a local profile, not diskless network homes. Maybe you could write an rsync script at login/logout that does just that.

You might have better luck mounting or symlinking shares to specific subdirectories such as Documents or .mozilla. Those don't make use of special filesystem features.

Cheers!

kumar007
January 3rd, 2013, 08:26 PM
Mounting on other sub-directory should work for me.
I would still need a script to auto mount it based on user credentials.