how can i run smbmount automatically when a user login
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
how can i run smbmount automatically when a user login
hi all,
i want to use winxppro as my file server and linux(mandrake9.1)as a client.situation is of following
1.i have 5 directories on ntfs partitions on my winxppro(a,b,c,d,e,f).
2.i have 5 different users 1,2,3,4,5 who has diferent partitions on those directories.
3.i have 5 users with smbpaaswd created on my linux pc .
4.for each user i have written a scripts file where i have actually placed smbmount commands with proper permissions set for each user for each directory.e.g
smbmount //win/a /home/1/win rw,username=<>,password=<>,uid=<>,dmask=0765,fmask=0765
5.i have five scripts written for each user with different set of permiossions on diffferent directories
6. when user 1 runs this it asks for passwords for different directories and after providing proper passwords he can share directories on winxp with proper rights.
but users find it reallydifficult to provide passwords for each directories.so i want to run these scritps whenever a perticuler user logs in (locally), when they logoff locally these all mount points should be umounted automatically.
i belive there should be solution to this and somebody can help me to do this.
I would rather the smbmount command not run when the user accesses his/her profile via other mechanism such as ssh. Only mount the drives when he/she sits down at the workstation and opens a desktop manager (gnome, kde, enlightenment, fluxbox, etc).
Folder permissions should be set on the ntfs side, not on the client side.
You shouldnt need smbpasswd at all. The only time that should matter is if you are logging into a domain controller.
you can use fstab and sudo, probably with better security as well as then using credentials files(instead of username=blah, password=blah)that are only visible by root.
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 158
Rep:
.bashrc and .bash_profile not good to automount drive
Hello soulestream,
Thanks ... but adding smbmount to those files doesn't work as I'd like.
.bash_profile doesn't mount the drives at all.
.bashrc mounts them every single time I open a terminal such as gnome-terminal (multiple mounts of the same drive start stacking up for the same user).
Here's the code that I put at the end of .bash_profile and then at the end of .bashrc:
sudo mount -a
Could not resolve mount point ~/drives/share
Anyone have ideas about how to automount drives (be it in the user's home directory or elsewhere) when the user logs into a desktop manager (gnome, kde) rather than when the user opens a ssh session or every time a terminal is opened.
I'd also like the mount points to be release when the user logs out.
well,
Better write all the mount commands in a shell script and call it form .bashrc...
but first check for already mounted file system in u r script file...
like
#!/bin/bash
count=`mount | grep -c drives/books`
if [ count -lt 1 ]; then
# u r mount statement goes here
fi
I feel you have to apply conditions for all your file systems... and the call this script from any file which is executed automatically, say at startup or say .bashrc
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.