Samba share mount as "user" failed

Samba share mount as "user" failed

Postby mackowiakp » Nov 20th, '16, 09:18

I want to mount samba share from M5 server to M5 desktop. My entry for that share in fstab on desktop is:

Code: Select all
//media/Gosia_ISO /home/maciek/SMB-1 cifs user,noauto,credentials=/home/maciek/.smbfile 0 0


I want to mount this share on-demand by user. It is possible to mount it from root using such entry in bash script on desktop:

Code: Select all
mount //media/Gosia_ISO


The entry for that share in smb.conf file on M5 server looks like this:

Code: Select all
[Gosia_ISO]
    path = /home/media/disk-2/Gosia_ISO
    comment = Gosia_ISO
    browseable = yes
    public = no
    writable = yes
    create mask = 0644
    directory mask = 0755
    force create mode = media
    force group = media
    valid users = media


But mounting share from user level, rapports an error:

Code: Select all
[maciek@Piotr ~]$ mount //media/Gosia_ISO
mount: //media/Gosia_ISO: No such file or directory


or

Code: Select all
[maciek@Piotr ~]$ mount //media/Gosia_ISO /home/maciek/SMB-1
mount: Only root can do it
[/code]

Or if I want to access it from Dolphin, it rapports in such way:

Code: Select all
Error during access to 'Gosia_ISO on media', system rapports: This program is not installed setuid root - "user" CIFS mounts not supported.


I try to install setuid but there is no one in M5 repo.
What I am doing wrong? Any help?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Samba share mount as "user" failed

Postby wintpe » Nov 22nd, '16, 11:24

what your doing in general should work, but its not obvious to me at this stage.

however there is a far easier way to do this, which has a much better performance and thats NFS combined with automount

automount (or autofs as its refered to in the linux world) intercepts all requests to cwd and if that
working directory matches a directory setup in the automap

it runs mount -t nfs servername:/export/share/home /localdir/share/home

it also times out the mount depending on the timeout value set in /etc/sysconfig/autofs

its perfect for what you want, and something we use across thousands of servers where i work.

for auto mounting home directories on login, for auto mounting application directories on app start up, you name it we use it for
everything and have no permanent mounts at all.

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Samba share mount as "user" failed

Postby mackowiakp » Nov 22nd, '16, 12:06

NFS is not good solution for me, because i want to access the same share on-demand from iPad and Android based phone. So Samba is better in this case.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Samba share mount as "user" failed

Postby wintpe » Nov 23rd, '16, 12:17

that does not change anything ive said.

all my file servers are dual protocol, NFS for unix,
server message block for all other devices.

and then you unix hosts can take advantage of autofs.

this is so common an aproach, SELINUX on redhat based distributions has a boolian mode switch for it.

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Samba share mount as "user" failed

Postby mackowiakp » Jul 26th, '17, 10:59

But it worked in M5, and still work on my wife M5 based PC (not updated to M6 yet).
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Samba share mount as "user" failed

Postby hviaene » Jul 30th, '17, 11:05

There is something not clear to me in your setup. I copy below:
On your desktop:
"//media/Gosia_ISO /home/maciek/SMB-1 cifs user,noauto,credentials=/home/maciek/.smbfile 0 0"
To me the reference to the server machine is missing. I would expect to see something like
//<servername or address>media/Gosia_ISO /home/maciek/SMB-1 cifs user,noauto,credentials=/home/maciek/.smbfile 0 0"
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Samba share mount as "user" failed

Postby mackowiakp » Jul 30th, '17, 11:41

"media" is The server mamę. Gosia_ISO is the mamę of share.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Samba share mount as "user" failed

Postby hviaene » Jul 30th, '17, 11:52

What you do not give: what is the user on the desktop, what is the user on the server owing the share, and what samba user do you have???
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Samba share mount as "user" failed

Postby mackowiakp » Jul 30th, '17, 12:08

It is in "credential" file
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Samba share mount as "user" failed

Postby doktor5000 » Jul 30th, '17, 14:50

That does not answer the question.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Samba share mount as "user" failed

Postby mackowiakp » Jul 30th, '17, 17:18

I really dont know what to say. Its just ordinary user created on QNAP NAS, dedicated for storing ISO files from my home PC's and other backup files like router cofigs etc. One of subdir of that user is available as SAMBA share on LAN.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Samba share mount as "user" failed

Postby hviaene » Jul 31st, '17, 10:00

I'll explain: if I am working as user A on a Samba client - in your case the desktop - and the share on the server is owned by user B, then you can have connection problems. Having defined sambausers (this is not the same as a Linux user with which you login), can make a difference one way or the other. Apparently what you announced as server is a NAS (?), but that does not make a difference.
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Samba share mount as "user" failed

Postby mackowiakp » Jul 31st, '17, 17:09

Yes, of course. You are right. Samba user is usually not equal to system user. But SAMBA server configured via GIU on my NAS QNAP TS-453A - (4 core Intel based, 64 bit OS) by default provides share access with user/pass the same as the owner of home directory the share is located.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Samba share mount as "user" failed

Postby hviaene » Jul 31st, '17, 18:21

mackowiakp wrote:Yes, of course. You are right. Samba user is usually not equal to system user. But SAMBA server configured via GIU on my NAS QNAP TS-453A - (4 core Intel based, 64 bit OS) by default provides share access with user/pass the same as the owner of home directory the share is located.

OK, but what is your user on the desktop???
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Samba share mount as "user" failed

Postby doktor5000 » Jul 31st, '17, 18:28

You don't see the issue, do you? You don't show details about user A nor remote user B nor the respective samba properties.
Nor any debugging output when mounting the share as root with either mount -v or mount.cifs. To add to the confusion in the OP you want to mount from mga5 server to mga5 client, now it's about mga6 client from NAS QNAP TS-453A samba server.

But still you would like to receive proper help ... good luck.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Samba share mount as "user" failed

Postby wintpe » Aug 1st, '17, 17:49

why dont you aproach diagnosing this differently, ignore the mounts for now.

use the cli tool smbclient

smbclient -L //media
Enter root's password: (just hit return here)
Anonymous login successful
Domain=[xxxxx] OS=[xxxxxx] Server=[xxxxx]

Sharename Type Comment
--------- ---- -------


so now try

smbclient //media/Gosia_ISO -U mackowiakp
Enter mackowiakp password:
it might come back with

session setup failed: NT_STATUS_LOGON_FAILURE

or some other error message

this will help us understand what works.

if it succeeds use smbclients logged in command line to test capabilities, ie dir

it may not work, but it will help

theres lots more here

http://www.tldp.org/HOWTO/SMB-HOWTO-8.html

https://access.redhat.com/documentation ... share.html





regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest