LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-09-2007, 03:29 AM   #1
Mr T Donegal
Member
 
Registered: Feb 2004
Location: Netherlands
Distribution: Suse 9.3
Posts: 31

Rep: Reputation: 15
Samba Konqueror Mount Permission problem


Hi,

I'm trying to mount samba shares on a remote server from konqueror. The remote server is a network drive.

I can 'access' the shares through konqueror at the address: //server/shared, but I want to 'mount' the shares as a normal user. I can mount the shares as root by issuing the following command AS ROOT from the command line:

mount -a

This works by reading the following line I added to /etc/fstab:

//server/shared /home/name/Shares/MountPoint smbfs username=user,password=pass,uid=1002,gid=1003,dmask=770,fmask=770 0 0

The shares are then mounted successfully in Konqueror.

Upon subsequent boot-ups, the shares appear as 'unmounted' in konqueror. Upon clicking on a share, the following error message is encountered:

Permission denied

Note: the shares are not mounted at bootup, because the network is not up when /etc/fstab is loaded, and also it is essential to be able to switch-off the network drive for much of the day and at night to save energy, and to switch it back on again only when needed.

I do not know how to allow an ordinary user to mount the shares. I do not want to go to the command line, and become root every time I need to mount the shares. Is it possible to give permission to an ordinary user to mount the shares? Also, the shares need to be read-write.

I think it is a bug in Konqueror that these shares show up when the user has no permission to mount them - not very user friendly!

Many thanks for any help.
 
Old 07-09-2007, 03:54 AM   #2
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
Please clarify what you're asking: You have a remote machine with samba running. You want to be able to mount the samba share on your local machine, but the remote machine isn't always switched on when the local machine boots up, so the mount won't always work from /etc/fstab. For this reason you want to set the samba mount on the local machine so that a normal user can mount the share some time after boot. Correct?

I'm not sure how to advise on this, as last time I checked, samba mounts weren't possible as a normal user, even with 'noauto,user' options added in fstab (I think this was due to a security issue with mount.smbfs being setuid root, but I can't remember exactly). Maybe someone else can advise you better on this.

As for the "bug" in Konqueror, I suspect that the shares are configured on the server end with "browseable = yes". Shares with this option will appear to anyone who looks at the server, regardless of whether they have the permission to mount them. This isn't a bug, I'm pretty sure the behaviour is the same when you're looking at shares via Windows too. For one thing, how would Konqueror know whether you have permission to mount a share that it finds, without trying to mount it?

To mount the shares as read-write, you must configure them as such on the server first. You also need to mount them read-write on the local machine, by setting the file_mode and dir_mode (cifs) or fmask/dmask (smbfs), which you seem to have done. Adding the option 'rw' to the mount shouldn't hurt either.

For what it's worth, if you only have Linux hosts on your network (i.e. no Windows), I recommend using NFS instead. It gives better performance (for me at least) and is easier to configure.
 
Old 07-09-2007, 04:49 AM   #3
Mr T Donegal
Member
 
Registered: Feb 2004
Location: Netherlands
Distribution: Suse 9.3
Posts: 31

Original Poster
Rep: Reputation: 15
Hi Gethyn,

Thanks very much for your quick response. To clarify what I was asking, that was in the second last paragraph:
Is it possible to give permission to an ordinary user to mount the shares?
That should have been:
Is it possible to give permission to an ordinary user to mount the shares in Konqueror?

Also, that is 'mounting' rather than 'accessing' (which was already possible)

I have done some further experimentation through trial-and-error, and by adding ",user,noauto" to the line in /etc/fstab, I was able to achieve the desired result:

//server/shared /home/name/Shares/MountPoint smbfs
username=user,password=pass,uid=1002,gid=1003,dmask=770,fmask=770,user,noauto 0 0

(The 'commas' had thrown me previously.) The share can now be mounted in konqueror by clicking on it.

Regarding bugs, I think it is a 'bug' if the user cannot go further, [i.e. 'Permission denied' = full stop.]. A solution would be to include a message: 'You do not have permission to mount this remote directory, click here for further information, and possible solutions', or a dialog box: 'Enter administrator/root password to continue', for example. Konqueror could be programmed to check if the share is mountable by ordinary user before displaying the icons (i.e. in this case it was the local, not remote machine that denied access). I don't think Windows is a good role model in this regard! This would be a usability bug rather than a programming bug.

Anyway, thanks again for your insight, and I'll consider using NFS in future, though in this case the network disk came with Samba. Incidentally, can NFS shares be accessed by Windows and Mac?
 
Old 07-10-2007, 08:17 AM   #4
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
Glad you managed to get it working. I've never tried setting things up to be mounted by Konqueror, which might explain why I got confused about exactly what you were after.

Since I have neither Windows nor a Mac, I've never tried to set up NFS in either of them. However, a quick search on the web suggests it is possible. Microsoft even have a guide on how to install their NFS client ("How to install Client for NFS on Windows for a UNIX-to-Windows migration"!). Likewise, there are a number of howtos to set up NFS under OS X. It looks as though earlier versions of Mac don't support it though. Whether configuring your non-Linux computers to use NFS would be less work than getting the Linux computer to use Samba I've no idea.

I agree, the behaviour in Konqueror could be more helpful, I hadn't realised that it was a problem with mounting rights at the client end, as opposed to authentication rights at the server end. Incidentally, smbfs is no longer maintained by the samba project. It's been superseded by cifs, although you may well not get any benefits by switching to it on a simple home setup.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba permission problem (probably) pingu Linux - Software 3 01-26-2010 01:23 AM
NFS mount of smb mount of windows share: permission denied problem :( Bagatur Linux - Networking 4 07-07-2009 11:34 AM
nfs mount problem on Fedora - permission denied hueofwind Linux - Networking 2 04-12-2006 07:23 PM
fc4 mount permission problem gfem Fedora 2 01-04-2006 09:34 PM
apche permission problem after i mount windows share in linux niloshima Linux - Networking 1 12-20-2005 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration