Announcement

Collapse
No announcement yet.

auto-Mounting Samba

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    auto-Mounting Samba

    Dell Inspiron 8000
    Kubuntu dapper
    KDE

    i'm trying to auto mount a samba share at start-up. I have edited my FSTAB as follows:

    Code:
     # /etc/fstab: static file system information.
     #
     # <file system> <mount point>  <type> <options>    <dump> <pass>
     proc      /proc      proc  defaults    0    0
     /dev/hda1    /        ext3  defaults,errors=remount-ro 0    1
     //shinyduck/multimedia /home/masterevilace/Multimedia smbfs user,ro 0 0
     /dev/hda5    none      swap  sw       0    0
     /dev/hdb    /media/cdrom0  udf,iso9660 user,noauto   0    0
    This makes an icon appear on my desktop to the share, and I can right click and mount the drive perfectly. I can't unmount it, however, as it says only root can unmount. This isn't a problem, but if this can be fixed, that would be cool.

    The problem is the drive does not automount itself. It just allows me to mount it. I even tried putting "auto" in my options in the fstab, but that still does not auto-mount it.

    The windows share is read-only, and doesn't require a password to access.

    #2
    Re: auto-Mounting Samba

    To have mount/umount as a user you could try editing your sudoers (visudo from a terminal) to allow users to umount.

    As for your fstab, last time I checked, samba needs your credentials when mounting. So you need to add a credentials= bit in there (don't add the login details directly in the fstab even if it does work, it's not secure)

    Code:
    //shinyduck/multimedia /home/masterevilace/Multimedia smbfs credentials=/path/to/credentials/file,uid=userid_here,gid=groupid_here,ro 0 0
    and you'll need to create the credentials file somewhere (preferably not in a directory that is shared :P ), with the following:
    Code:
    username=whatever
    workgroup=whatever
    password=whatever
    then you'll need to deny everyone else access to this credentials file:
    Code:
    $ cd /path/to/credentials/directory
    $ chmod a-rwx credentials_file_name && chmod u+r credentials_file_name
    Hopefully that'll work for you.

    Comment


      #3
      Re: auto-Mounting Samba

      1. For your unmounting problems, you could try the option 'users' instead of 'user'

      2. There were a few problems with samba automounting some time ago (there were a few threads about it...can't remember if there was an ultimate solution)

      But one thing you could try is put the 'mount //shinyduck/multimedia' command in /etc/rc.local -script (the script is run at the end of multiuser boot sequences)

      Comment


        #4
        Re: auto-Mounting Samba

        Originally posted by Hestia
        As for your fstab, last time I checked, samba needs your credentials when mounting. So you need to add a credentials= bit in there (don't add the login details directly in the fstab even if it does work, it's not secure)
        For some reason, whenever I add the uid/gid stuff (and/or even credentials), I get problems at boot. boot stops / slows to a CRAWL at "starting hardware abstraction layer hald".. which causes a lot of KDE stuff to not function when it does get to the desktop. this is why i never left all that in.

        I figure I don't specifically need it because I can right click and mount it on my own no questions asked :shrug:

        Originally posted by kubicle
        But one thing you could try is put the 'mount //shinyduck/multimedia' command in /etc/rc.local -script (the script is run at the end of multiuser boot sequences)
        Sadly, this doesn't work. I can type the mount command in manually, it then asks for my password, and then it'll mount fine.

        Is there a way to combine the credentials stuff with the mount rc.local stuff in order to bypass asking for a password so it can mount?

        Comment


          #5
          Re: auto-Mounting Samba

          Originally posted by MasterEvilAce
          Originally posted by Hestia
          As for your fstab, last time I checked, samba needs your credentials when mounting. So you need to add a credentials= bit in there (don't add the login details directly in the fstab even if it does work, it's not secure)
          For some reason, whenever I add the uid/gid stuff (and/or even credentials), I get problems at boot. boot stops / slows to a CRAWL at "starting hardware abstraction layer hald".. which causes a lot of KDE stuff to not function when it does get to the desktop. this is why i never left all that in.

          I figure I don't specifically need it because I can right click and mount it on my own no questions asked :shrug:
          hmmm, no idea then. I guess it works for some distros and not for others.

          Is there a way to combine the credentials stuff with the mount rc.local stuff in order to bypass asking for a password so it can mount?
          If what you want is to do the mount last, you could also make use of the /home/user/.kde/Autostart (the good thing with this is that only you mount the share). Create a little script containing the mount command, save it as whatever.sh and make it executable (chmod +x whatever.sh). Try both with rc.local and ./kde/Autostart, experimenting in linux is probably the best way to learn

          Comment


            #6
            Re: auto-Mounting Samba

            Hey, putting the script in autostart works fine.

            I'm curious as to just why it doesn't ask me for a password to mount it that way, though..

            But it does work, thanks a bunch

            Comment


              #7
              Re: auto-Mounting Samba

              When you do visudo, do you see an entry in there for mounting? That's the only thing that comes to mind really.

              Comment


                #8
                Re: auto-Mounting Samba

                Well...commands in autostart are run as 'user'...while rc.local is run as root, that's the only (relevant) difference that I'm aware of.

                But it is odd you would need to enter the admin password to mount from console (unless you use 'sudo mount'...which you don't need to as you've enabled user mounting in fstab)

                My experiences with samba are very limited, perhaps one with 'hands on' knowledge can provide more insight. :P

                Comment

                Working...
                X