LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-08-2016, 01:43 PM   #1
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 890

Rep: Reputation: Disabled
Cannot mount Samba share by non-root user


Hi,

I have the following line in /etc/fstab:
Code:
//OLAB/shared  /home/antezu/share/olab  cifs  users,dir_mode=0700,file_mode=0600,defaults,noauto,rw,uid=antezu,gid=users,credentials=/home/antezu/.samba.olab.txt  0  0
The root user has no problems mounting the share by simply:
Code:
$ mount /home/antezu/share/olab
But when I try to mount as regular user, I get:
Code:
This program is not installed setuid root -  "user" CIFS mounts not supported.
I go ahead and setuid on /sbin/mount.cifs:
Code:
$ chmod 4755 /sbin/mount.cifs
Now I try to mount again as regular user and I get:
Code:
Unable to set current process capabilities: Operation not permitted
error 2 (No such file or directory) opening credential file /home/antezu/.samba.olab.txt
Is there any way to make it work without using sudo or being root?
I don't want the user to use the terminal, I would love to have it "click through".

There is this shiny little icon on my Xfce desktop begging to be clicked, it would be really nice if after clicking it, the share was mounted, instead of receiving:
Unable to set current process capabilities: Operation not permitted
error 2 (No such file or directory) opening credential file /home/antezu/.samba.olab.txt


Any help on that matter?

--
Best regards,
Andrzej Telszewski
 
Old 02-08-2016, 02:00 PM   #2
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,708

Rep: Reputation: Disabled
you can use gvfs (if running in an existing dbus session, like Xfce does)
Code:
gvfs-mount smb://{ip.of.the.server}/shared
the drawback is that the mounted directory will be placed in ~/.gvfs named like "smb-share:server={ip.of.the.server},share=shared"

also writing in the location line of thunar
Code:
smb://{ip.of.the.server}/shared
should do: the result is exactly the same.

I suppose your shortcut should launch the command
Code:
thunar smb://{ip.of.the.server}/shared

Last edited by ponce; 02-08-2016 at 02:12 PM.
 
Old 02-08-2016, 02:15 PM   #3
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 890

Original Poster
Rep: Reputation: Disabled
Hi,

@ponce
If at all possible, I would prefer to have it working through the icon that shows up on the desktop.
Also, my desktop is a mix, I'm using Konqueror and not Thunar. In Konqueror I can do the same, that is paste the address and provide username/password, but the experience is not the same as with mounted directory, if you know what I mean.

Using the icon on the desktop gives me a bit of automation, that is every share I add to /etc/fstab will automatically show up on the desktop and I also receive nice feedback if mounting succeeded. The problem is that the feedback I receive is fail to mount

EDIT:
Also, if mounted with gvfs, I cannot access the documents from within Konqueror.

--
Best regards,
Andrzej Telszewski

Last edited by atelszewski; 02-08-2016 at 02:19 PM.
 
Old 02-08-2016, 03:25 PM   #4
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 890

Original Poster
Rep: Reputation: Disabled
Hi,

I succeeded [I'm on -current]

I followed this post and:
1. Installed libcap-ng
2. Then I've rebuilt the cifs-utils-6.4 package.
3. Then $ chmod 4755 /sbin/mount.cifs

I also had to remove the defaults option from fstab as cifs complains about it.

Seems to be working just fine (tm)

--
Best regards,
Andrzej Telszewski
 
2 members found this post helpful.
Old 07-25-2018, 10:52 AM   #5
Luiz Ramos
LQ Newbie
 
Registered: Jun 2010
Location: São Paulo - Brazil
Distribution: Slackware, Debian
Posts: 19

Rep: Reputation: 1
Trick working in other conditions

Hi,

Quote:
Originally Posted by atelszewski View Post
Hi,

I succeeded [I'm on -current]

I followed this post and:
1. Installed libcap-ng
2. Then I've rebuilt the cifs-utils-6.4 package.
3. Then $ chmod 4755 /sbin/mount.cifs

I also had to remove the defaults option from fstab as cifs complains about it.

Seems to be working just fine (tm)

--
Best regards,
Andrzej Telszewski
If this matters for anyone, this trick also succeeded in conditions slightly different from that above:

- Slackware 14.1 multilib
- cifs-utils 5.5

Anyway, the main procedure was:

- build/install libcap-ng 0.7.3 from slackbuilds.org (14.1, x64)
- rebuild cifs-utils 5.5. Here an additional trick was needed: including "-Wno-unused-result" in CFLAGS before ./configure
- after install, run chmod 6755 /sbin/mount.cifs

Many thanks,

Luiz Ramos
São Paulo - Brazil

Last edited by Luiz Ramos; 07-25-2018 at 10:53 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Root can't chown mount point for samba share? damgar Linux - General 3 06-01-2010 03:03 AM
Mount windows/samba share as non root user stuartornum Linux - Newbie 3 01-22-2008 11:28 PM
mount samba share as guest user twac Linux - Software 3 06-05-2007 01:55 PM
Mount samba share at boot with user write permissions Wynd Linux - Software 2 08-21-2006 11:48 PM
can't mount smb share as non-root user nixinbarrie Linux - Networking 5 09-27-2004 08:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:03 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration