Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 17th January 2009, 10:30 PM
jbkt23 Offline
Registered User
 
Join Date: Mar 2006
Posts: 510
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
Reply With Quote
  #2  
Old 18th January 2009, 12:15 AM
jbkt23 Offline
Registered User
 
Join Date: Mar 2006
Posts: 510
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
Reply With Quote
  #3  
Old 18th January 2009, 12:33 AM
jbkt23 Offline
Registered User
 
Join Date: Mar 2006
Posts: 510
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
Reply With Quote
  #4  
Old 25th January 2009, 09:57 PM
jbkt23 Offline
Registered User
 
Join Date: Mar 2006
Posts: 510
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
Reply With Quote
  #5  
Old 25th January 2009, 11:02 PM
Zotter's Avatar
Zotter Offline
Registered User
 
Join Date: May 2004
Location: Central Wyoming
Posts: 637
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.
__________________
If it ain't broken - you're not really trying....
Registered Linux user #227845
Reply With Quote
  #6  
Old 26th January 2009, 12:00 AM
jbkt23 Offline
Registered User
 
Join Date: Mar 2006
Posts: 510
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
Reply With Quote
Reply

Tags
clients, linux, samba, setup, share

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba share setup, not quite working mickwombat Using Fedora 6 20th August 2009 11:18 AM
How do I set up a very, very samba share between 2 linux PC's okorkie Using Fedora 6 9th December 2007 10:17 PM
share a fat32 drive within linux over nfs? samba? 3006828 Servers & Networking 1 5th October 2006 05:41 AM
Sharing a Samba file service with Linux clients JonR Servers & Networking 7 20th June 2005 02:43 PM


Current GMT-time: 06:02 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat