Results 1 to 7 of 7

Thread: mount script after login

  1. #1
    Join Date
    Apr 2012
    Beans
    5

    Post mount script after login

    Hi @ll,

    I need to run a script after user login to auto-mount a shared folder.

    The password for the shared folder is located in the encrypted user directory (/home/user) and therefore only accessible after login.

    How would you setup this to work?

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,758
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: mount script after login

    Hi paulwall.

    Then it looks like the best place is to set a task on 'Startup Application' under your system menu. The task defined there are executed right after you login into the GUI.

    I hope that helps. Tell us if you need more help with that.
    Regards.

  3. #3
    Join Date
    Apr 2012
    Beans
    5

    Cool Re: mount script after login

    Yes, it would start after login, but I cant mount a share in my script if I have no root permissions..

  4. #4
    Join Date
    Dec 2007
    Location
    California
    Beans
    4,954
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: mount script after login

    Would putting it in fstab, with the noauto and user option work? noauto would make it not mount at boot time, user would allow a regular use to mount it.
    "You can't expect to hold supreme executive power just because some watery tart lobbed a sword at you"

    "Don't let your mind wander -- it's too little to be let out alone."

  5. #5
    Join Date
    Apr 2012
    Beans
    5

    Re: mount script after login

    thank you.. this is what I've found after over 4 hours of search

    This seems to work but files are created with root as owner and I can't edit them on the shared folder..

    Permissions for unmounted shared folder on /mnt/mysharedfolder are set to chown myuser:myuser /mnt/mysharedfolder.

    The user option in /etc/fstab seems to be the problem, because if I set the options to uid=myuser,gid=users,rw,noauto,exec,sync and mount it with root permissions it will work.

    With the user option it will mount without root permission but files are created as root user?
    Last edited by paulwall; April 25th, 2012 at 08:57 PM.

  6. #6
    Join Date
    Mar 2011
    Location
    South Korea
    Beans
    289
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: mount script after login

    Try this application.
    I autorun
    I do not know how it works
    sorry..





    udisks man


    #!/bin/bash
    udisks --mount /dev/sdbx


    #!/bin/bash

    udisks --unmount /dev/sdbx

  7. #7
    Join Date
    Apr 2009
    Beans
    10

    Re: mount script after login

    Hi, sorry to raise an old thread, but I'm having trouble finding an answer to my question, which is almost answered here.

    Where would be the place to find an answer like the one I need?

    I wish to add automount to my fstab (i guess, so a disc is mounted at boot) but also to add 'inherit' to the modifiers, so all the files inherit the parent directory permissions. I would also like to know how to add this modification to a setting so any time I mount the drive after boot, say I unmounted it, then it mounts with the 'inherit' option.

    I read somewhere that this is the answer to removing the $SECURIY_DESCRIPTOR from the files on an ntfs drive, so the defragmenter doesn't freak out so much, and they are unmovable

    Can you give me a sample fstab listing?

Bookmarks

Posting Permissions

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