Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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!
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.
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:
(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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.