I have a dual boot system with OpenSUSE 11.3 and Windows XP.
I would like to have OpenSUSE mount the windows drives (C,D,E) only when one particular user logs in, and not be accessible for the other users.
I have tried playing with the fstab options (do not mount at startup + user can mount, creating a new user group ‘mounters’ and replacing the ‘users’ in th the fstab line with ‘mounters’ etc.) but this is not doing what I want.
Not an answer, but perhaps a push in the right direction?
I’m also using 11.3 and XP My Windows drive is mounted as /windows/c as was suggested during install. The entire drive is one partition as MS wanted it.
When I look at the properties of the “windows” folder, I see the owner listed as root and the group is also root. Of course, the owner has read/write/execute authority. the group has read/execute and all others have read/execute.
Could you reset the group ownership of the entire drive to be mounters and give them read/write/execute, and revoke all rights to all others? They would be able to see there is a windows drive but would not be able to see what’s there. Would that work for your situation?
Another thought might be to take the windows statement out of the /etc/fstab file and create a script that mounts it only when the user is a member of the mounters group. Once more, all users could see a partition in “My Computer”, but could not mount it without root password.
i’m not an expert…but, my opinion: root can mount drives…so, only
let the person who should see the win-drives have the root password,
then that person mounts them on arrival, and unmounts them on departure…
a little executable script for both situations could be made and run
from the run command…you don’t say which desktop environment you
use, but if it were KDE i could tell you how to run that mount script
automatically when you log in…auto-logout, i’m not sure about…
Thanks Bart. Indeed the right direction as you will see below.
However, changing the ownership of the windows drives was not possible - at least from the File Manager in Super User mode - selecting change permission for all files (recursive) and folders was not actually doing that.
As for mounting as root, the trouble was that once mounted, unless explicitly unmounted, the drives remained mounted even after logging off and when another user logged in too.
Thanks DenverD, expertise is relative (to me) :). Yes it is KDE. As above, I believe your solution works, the only downside being that unless there is a script at logout and it ran each time, everyone else logging in would get access.
What worked for me:
I continued with a new user group called mounters and added the only user id that should access /windows to the group.
Then edited fstab via Yast for the three windows drives to read thus:
locale=en_US.UTF-8,uid=myid,gid=mounters,umask=0007
The option was to mount at startup, The permissions of the drives and the files within were correctly set to allow read-write-execute access to the ‘mounters’ group and ‘myid’ userid; all others were forbidden (by the umask 0007). I.e., did not change drive/folder permissions manually - they were set up at boot/mount automatically. I checked logging in from other ids and it works perfectly.
Thanks for solving this conundrum, mailglasso. I could only get it to work when I did not specify a uid. But otherwise a very elegant and effective solution. Now, if I could only get a similar solution in Windows for my data drive, I’d be set.
> Thanks Bart. Indeed the right direction as you will see below.
> However, changing the ownership of the windows drives was not possible
> - at least from the File Manager in Super User mode - selecting change
> permission for all files (recursive) and folders was not actually doing
> that.
It can’t be done for windows partitions. Instead, you adjust fstab, as you write below.
> I continued with a new user group called mounters and added the only
> user id that should access /windows to the group.
> Then edited fstab via Yast for the three windows drives to read thus:
> locale=en_US.UTF-8,uid=myid,gid=mounters,umask=0007
That’s it.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))
I propose you might have added that a mount /dev/sdx /windows command in sudoers only for that user.
Then only he and root permitted would have been able to mount those partitions.
Thanks, I will try it next time.
One question though, will this solution automatically unmount the drives at logoff, so the other users don’t get to access them?