samba share setup on linux clients
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2006
    Posts
    717

    samba share setup on linux clients

    I have a samba server and a new linux client that the 5
    members of the family will use. Prior to this the client was
    a win2000 machine with the shares defined per user as mapped
    drives. I would like to create a similar functionality on
    the new linux setup.
    What I want to achieve is to have these shares mapped when
    they login so that when they open applications that store
    data on the server the application finds the data.
    The server has shares defined per user and per users who are
    members of certain groups.
    I use the gnome desktop on the client. In the nautilus
    browser I can see the shares that are browseable and visit
    them. I can mount the user shares by smb://server/sharename
    and entering the password when asked. The user share mapping
    established this way sometimes persists from session to
    session, but I don't know if it will be dependable or
    recognized by applications. I have been looking at the
    gconf-editor to see if I could define the shares there but I
    have not as of yet figured it out.

    I would like to avoid setting up mount points in fstab. Is
    there a tutorial on line to show how to setup what I want?
    jbkt23
    Thinkpads Depends on era T23 - X2xx
    AMD & Intel Boxes

  2. #2
    Join Date
    Mar 2006
    Posts
    717
    Well doing my own testing I think I may have a work around if I can make it possible for the user to use the command
    $ mount.cifs //server/sharename -o credentials=/pathtouserreadonlycredentialsfile

    per man mount.cifs

    The mount.cifs utility attaches the UNC name (exported network
    resource) to the local directory mount-point. It is possible to set the
    mode for mount.cifs to setuid root to allow non-root users to mount
    shares to directories for which they have write permission.

    So once I can figure this out I can add the mount command to the users .bash_profile and create the necessary mount points in their home directories.

    So how do I make a user command setuid root?
    jbkt23
    Thinkpads Depends on era T23 - X2xx
    AMD & Intel Boxes

  3. #3
    Join Date
    Mar 2006
    Posts
    717
    Found the this and I can now mount shares as user.

    su -c 'chmod u+s /sbin/mount.cifs'
    su -c 'chmod u+s /sbin/umount.cifs'
    jbkt23
    Thinkpads Depends on era T23 - X2xx
    AMD & Intel Boxes

  4. #4
    Join Date
    Mar 2006
    Posts
    717
    I have cobbled some crude scripts together now, that mount samba shares when the user logs in, and then un-mount the shares and deletes the mount points on log out.

    Here is the script to mount the shares. I will put a link to this with the name of the shares to mount in >System>Preferences>Personal>Sessions<.
    ################################################## ####
    #!/bin/bash
    # sharemount <sharename 1> <sharename 2>
    # This script will test for bagend on the network and then mount shares or
    # issue an error message

    share="$@"

    if ping -w 2 -c 1 bagend && smbclient -NL bagend; then
    echo "bagend is present"
    for share in "$@" ; do
    mkdir ~/$share
    mount.cifs //bagend/$share ~/$share -o credentials=~/.samba/.$USERNAME
    done

    else
    echo "The server bagend could not be reached. Is it on?"
    fi
    ################################################## #######

    On the panel I have created an applet that runs the logout script that unmounts and deletes the mount points created with the first script.

    ################################################## ######
    #!/bin/bash
    # logout <share 1> <share 2>
    # this program un-mounts network shares and then calls gnome-session-save
    # with the --logout option

    share="$@"

    for share in "$@" ; do

    if [ -d ~/$share ]; then
    /sbin/umount.cifs /home/$USERNAME/$share
    wait=1
    rmdir /home/$USERNAME/$share
    fi
    done

    /usr/bin/gnome-session-save --logout
    ################################################## #############

    The scripts have worked for me without hangs.
    jbkt23
    Thinkpads Depends on era T23 - X2xx
    AMD & Intel Boxes

  5. #5
    Join Date
    May 2004
    Location
    Central Wyoming
    Posts
    649
    Samba is used as a server for Windows Clients.

    Though they can be shoe-horned into working, Linux's native sharing is done via NFS.

    If you don't have any Windows clients - you'll likely save yourself some headache by switching servers. Or, if you do have windows clients - setup both. Samba for Windows, nfs for linux.

    It's what I do and it saves what few hairs I have left.
    Registered Linux user #227845
    But, with the demise of the Linux Counter Project - who can tell...

  6. #6
    Join Date
    Mar 2006
    Posts
    717
    Samba isn't shoe horned here. It is a robust file server that is extremely well documented. I am running windows virtual guests on top of the linux host. I have been running a samba server for ten years and found it to be a flexible share access limiting setup.
    I have set up NFS in the past and it worked, but the documentation I found was very limited.
    jbkt23
    Thinkpads Depends on era T23 - X2xx
    AMD & Intel Boxes

Similar Threads

  1. Samba share setup, not quite working
    By mickwombat in forum Using Fedora
    Replies: 6
    Last Post: 20th August 2009, 11:18 AM
  2. Replies: 6
    Last Post: 9th December 2007, 11:17 PM
  3. share a fat32 drive within linux over nfs? samba?
    By 3006828 in forum Servers & Networking
    Replies: 1
    Last Post: 5th October 2006, 05:41 AM
  4. Sharing a Samba file service with Linux clients
    By JonR in forum Servers & Networking
    Replies: 7
    Last Post: 20th June 2005, 02:43 PM

Tags for this Thread

Posting Permissions

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