Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Mount Microsoft Share at login

  1. #1
    plemdog NNTP User

    Default Mount Microsoft Share at login

    I have an Open Suse 11 box that I am running as a multiple user server. All users will access this box via ssh. All users are logging in using the Microsoft Active Directory domain userid and password with no problem. I also have a MS Windows Server running as a fileserver and want each of the individual users to be able to mount their shared directory at login and unmount it at logout.

    I understand that mount is not available to non root users for security reasons, but if a non root user logs in on the console, they can easily access their shared space using by using "Connect to server" in Nautilus.

    The thing that I don't understand is why users cannot do this via the command line, but can via Nautilus. It seems that eventually Nautilus is running some command that should be available from the command line so that the shared space can be mounted without root access.

    Any insight would be appreciated. I feel like I might be missing something very simple here as this seems like a common thing to need to do in a multi-user environment.

    Thanks,

    Steve

  2. #2

    Default Re: Mount Microsoft Share at login

    i'm going to annoy you and ask you to take a little read here lol

    Samba: HowTo Mount a CIFS Network Share [AKA Map Network Drive] in openSUSE

    it's all explained in there, you will simply need to edit fstab, it's not that hard.

    hope this helps,

    Ross.

  3. #3
    Join Date
    Jun 2008
    Location
    The Netherlands
    Posts
    1,273

    Default Re: Mount Microsoft Share at login

    that was not exacly the question thestig.. Although a good read

    Steve,
    Haven't looked at this but I suspect Nautilus has permissions to execute a mount though GNOME's gvfs.
    Another difference is that the mount point is made in the home folders, so no extra rights are needed on the mount point itself.

    Curious now too,
    Wj
    Have a lot of fun!

  4. #4
    Join Date
    Jun 2008
    Location
    Oklahoma, US
    Posts
    822

    Default Re: Mount Microsoft Share at login

    Magic31 wrote:

    >
    > that was not exacly the question thestig.. Although a good read
    >
    > Steve,
    > Haven't looked at this but I suspect Nautilus has permissions to
    > execute a mount though GNOME's gvfs.
    > Another difference is that the mount point is made in the home folders,
    > so no extra rights are needed on the mount point itself.
    >
    > Curious now too,
    > Wj
    >
    >


    Likely using the FUSE user filesystem. Using FUSEfs, you can mount drives in
    your own subdirectories without asking root for help.

    -switch-topic-

    If you want a user to be able to mount/umount something listed in /etc/fstab,
    place the 'user' or 'users' option at the end of the options declaration
    (4th 'column') on the line in fstab describing the mount.

    'user' - only the user who mounted a filesystem can unmount it
    'users' - anyone can unmount it

    --
    L R Nix
    lornix@lornix.com

  5. #5
    plemdog NNTP User

    Default Re: Mount Microsoft Share at login

    Yeah, I had read the docs mentioned above already.

    Looks like FUSEfs will work. I certainly do only want the user to mount their shared space in their home directory when they login and then unmount it when loging out. They would be mounting something like //vault/home/username to a subdirectory of their home.

    I hoped to be able to script this in the login/logout scripts for the entire system.

    Sound doable?

    Thanks,

    Steve

  6. #6
    Join Date
    Jun 2008
    Location
    Oklahoma, US
    Posts
    822

    Default Re: Mount Microsoft Share at login

    plemdog wrote:

    >
    > Yeah, I had read the docs mentioned above already.
    >
    > Looks like FUSEfs will work. I certainly do only want the user to
    > mount their shared space in their home directory when they login and
    > then unmount it when loging out. They would be mounting something like
    > //vault/home/username to a subdirectory of their home.
    >
    > I hoped to be able to script this in the login/logout scripts for the
    > entire system.
    >
    > Sound doable?
    >
    > Thanks,
    >
    > Steve
    >
    >


    Definitely doable!

    {Sigh} *NOW* I've got to read up on the fusefs stuff... oh joy!

    if you were to put some commands into a user's .xinitrc, you could have a
    user's shared folder automounted into their home directory... something like
    this:

    (forgive the pigeon code, rusty on fusefs, but have concept in my head)

    # make sure mount point exists
    if [ ! -d ~/shared ]; then
    mkdir ~/shared
    fi
    fusemount smb://usernameassword@host/folder ~/shared


    Of course, now I can't remember how to get something to occur when a user logs
    out...

    the man page for xinit is informative, it says that when the xinitrc script
    exits, the user has logged out. The script does some setup, runs the window
    manager (kde/gnome/tvm/etc), and then exits. The window manager doesn't
    return until the user logs out... so:

    # sample .xinitrc script
    # do various setup tasks
    #
    # mount user's shared folder
    fusemount smb:... ~/shared
    #
    # run window manager
    do_win_manager
    #
    # umount the share
    fuseumount ~/shared
    #
    exit 0

    Or something like that {Jedi hand waving motion}

    Loni

    --
    L R Nix
    lornix@lornix.com

  7. #7

    Default Re: Mount Microsoft Share at login

    pam_mount exists for that purpose.

  8. #8
    Join Date
    Jun 2008
    Location
    Oklahoma, US
    Posts
    822

    Default Re: Mount Microsoft Share at login

    jengelh wrote:

    >
    > pam_mount exists for that purpose.
    >
    >


    Thank you! That helps quite a bit. I forget about the pam subsystem that
    exists, and that can do all sorts of amazing things, but I haven't read
    enough about yet...

    The phrase

    The more I learn, the more I learn, there's more to learn.

    keeps looping in my head.

    --
    L R Nix
    lornix@lornix.com

  9. #9
    plemdog NNTP User

    Default Re: Mount Microsoft Share at login

    Thanks guys, this is all really helpful. The only problem is that I can't find fusemount. I've installed all the fuse packages that I can find and do not have it.

    Would you care to explain how to use pam to do this too?

    Thanks,

    Steve

  10. #10
    Join Date
    Jun 2008
    Location
    The Netherlands
    Posts
    1,273

    Default Re: Mount Microsoft Share at login

    Quote Originally Posted by lornix View Post
    The phrase

    The more I learn, the more I learn, there's more to learn.

    keeps looping in my head.
    The more I learn, the more I realize I know only a small part of it all - is the one that boggles me

    The command should be fusermount (note the r)

    A good place to start could be here : FUSEWiki - FAQ

    Good luck & let us know what you learn

    Cheers,
    Wj
    Have a lot of fun!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •