Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mount different drives for different user
#1

Hi everyone,

 

I have a question I hope you can help.

 

I have 2 PCs, 1 running Windows and the other running SuSe Linux 9. Both PCs are connected through a LAN. I have different users using the Linux and I would like to mount their respective drives (located in the Windows PC) whenever they log on. This means that when user1 logs in, his drives will be mounted. The drives will be unmounted once he logs off. The mounting and un-mounting should be done automatically.

 

May I know how I can achieve this? Many thanks in advance.

Reply
#2

Quick and dirty, add a mount command into ~/.bashrc and a umount command into ~/.bash_logout. But that is a horrid method!

 

Automount could manage mounting "on-the-fly" meaning that when you enter a particular directory it would mount it then, after a preset idle timeout, it would umount it.

 

The *best* way would be to make PAM do it for you with the "pam_mount" module but it can be a bit tricky (or at least it was when I tried to make it work once before).

Reply
#3

Quote:Quick and dirty, add a mount command into ~/.bashrc and a umount command into ~/.bash_logout. But that is a horrid method! 

Automount could manage mounting "on-the-fly" meaning that when you enter a particular directory it would mount it then, after a preset idle timeout, it would umount it.

 

The *best* way would be to make PAM do it for you with the "pam_mount" module but it can be a bit tricky (or at least it was when I tried to make it work once before).
 

 

Thanks for your reply.. I will give it a try.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)