Reply
 
Thread Tools Display Modes
  #1  
Old 11-30-2018, 11:28 AM
edwardcoast is offline
Guest
 
Join Date: Jan 2014
Posts: 1,132

Samba share from CentOS has unusual permission issues from Mac OS.


This has been bugging me for a while, and I never seem to be able to find the source of the problem. So I thought I would post here to get ideas from those of you experienced with Samba shares hosted on CentOS and making them accessible to Macintosh desktop systems.

In our LAN, we have workstations which are Linux, Windows and Mac. I don't recall when this problem first started with the Mac, but it seems to be over a year ago. And the behavior of the problem is inconsistent and not always reproducible.

CentOS Linux release 7.5.1804 (Core)
Samba version 4.7.1.

Macintosh Mac OS 10.13.6

Each workstation uses Samba user login smbuser.

This is the problem, and only on the Mac. You can create a directory on the Samba share, move them around between directories, rename them, delete them, without a problem most of the time. But then for some reason, and this is why I'm posting about it, I need some trouble-shooting tips here, a Mac user tries to move the folder from one directory to another on the Samba share and will be prompted to enter in a username and password. If the user enters in the smbuser and password, it doesn't accept it. If even tried entering in user name root and the password, and while it does accept that, you it doesn't let you move the folder.

I have looked into the permissions and the permissions are 0775. For trouble-shooting while it wouldn't let me drag a folder and put it in another folder, I did a duplicate of the folder creating a "folder name copy" and I was able to drag elsewhere and rename it.

I have logged into the shell on the CentOS file server and doing a ls -ls, I could see the permissions and owner group and group are OK. I use the 'stat' command to confirm this, and it is an exact match. But for some reason, either Samba/CentOS or the Mac OS is not allowing some of these file/folder changes to the Samba share to take place.

I have looked in SMB logs and I don't see anything there. Is there some place else to look so when it gets prompted for permissions I can gather more debugging information? But from where can this be done on the Mac or on Samba/CentOS?

This is only happening on the Mac, the Linux and Windows workstations don't have this issue.

Here is a generic version of the smb.conf being used on CentOS for this LAN:
Quote:
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = OURSERVER
security = user
map to guest = bad user
dns proxy = no
ntlm auth = yes
#============================ Share Definitions ==============================
[BIGSHARE]
comment = BIGSHARE File Server
writable = yes
valid users = smbuser
path = /home/share
create mode = 0664
directory mode = 0775
browsable = yes
guest ok = no
read only = no
I'm open to suggestions to how to fix this problem. Willing to try things out too, of course. Thanks in advance!
  #2  
Old 12-01-2018, 11:43 PM
Melbourne is offline
Guest
 
Join Date: Nov 2009
Posts: 5,129
Don't assume that it is a permission problem just because the computer tells you so.

Computer systems are given only a limited number of ways that they can report failure, and frequently the reporting layer doesn't actually know the cause of the functional error.

In your case, the directory move operation failed: all the interface knows is that it failed: it gives you a chance to try again as a different user.

I don't know what is causing the problem, but since you suggest that it is inconsistent, possibilities to consider are (a) the MAC is making the folder the 'active' folder before trying to change it, (b) you are having trouble creating the hidden files used by the Mac (c) you are connecting with a protocol other than the one you think you are (ftp, nfs afp).
  #3  
Old 12-02-2018, 11:29 AM
edwardcoast is offline
Guest
 
Join Date: Jan 2014
Posts: 1,132
Quote:
Originally Posted by Melbourne View Post
Don't assume that it is a permission problem just because the computer tells you so.

Computer systems are given only a limited number of ways that they can report failure, and frequently the reporting layer doesn't actually know the cause of the functional error.

In your case, the directory move operation failed: all the interface knows is that it failed: it gives you a chance to try again as a different user.

I don't know what is causing the problem, but since you suggest that it is inconsistent, possibilities to consider are (a) the MAC is making the folder the 'active' folder before trying to change it, (b) you are having trouble creating the hidden files used by the Mac (c) you are connecting with a protocol other than the one you think you are (ftp, nfs afp).
I'm not assuming anything at this point. I know from experience with Samba things like this relate to permissions and authentication for logins. But whatever those problems were, it was usually it worked or not. This doesn't seem to follow a real pattern. Some folders in a directory won't let you rename them, while others do. One thing is constant, when this does occur, it stays that way even if I restart Samba. The only work around has been to login through the shell and do things there.

For now, I have placed this in the smb.conf file:
Quote:
#log level = 3 auth_audit:3 auth_json_audit:3
Note that it is commented. This generates a lot of data for the log files. So next time this unexplained behavior occurs I'm going to uncomment this line, restart Samba and repeat the action. Then examine the logs to see if I can get more clues as to what is going on. Even if it were an error message or warning that said something like "Can't establish foobaz on myfile" I would at least have something to research further.

The protocol is SMB. I have even removed the Mac's hidden files in the directory/folder and that doesn't stop this odd behavior. I would describe this Samba share environment as simple. I do know that adding the
Quote:
ntlm auth = yes
to the smb.conf was needed for support an older Windows 7 system. But my research has not turned up that the Mac cares about ntlm.

It could be the "active" directory issue you describe, but what is causing the events to behave abnormally is the mystery.

I've never really had to dig into the higher level Samba logs before, so this will be a learning experience.
  #4  
Old 12-02-2018, 03:18 PM
EdelweissPirate is offline
Guest
 
Join Date: Mar 2015
Location: Portland, OR USA
Posts: 464
This is probably not the source of your problem, but do I understand correctly that each user is sharing auth credentials? It sounds like they’re sharing the same username/password pair.

If so, you should know (if you don’t already) that this is a pretty bad practice from a security perspective. Furthermore, there can be issues with the maximum number of concurrent sessions for a given user which might create the symptoms you describe.

Is there some reason why users are sharing auth credentials? Is there some reason they’re not using domain auth credentials?
  #5  
Old 12-02-2018, 03:46 PM
edwardcoast is offline
Guest
 
Join Date: Jan 2014
Posts: 1,132
Quote:
Originally Posted by EdelweissPirate View Post
This is probably not the source of your problem, but do I understand correctly that each user is sharing auth credentials? It sounds like they’re sharing the same username/password pair.

If so, you should know (if you don’t already) that this is a pretty bad practice from a security perspective. Furthermore, there can be issues with the maximum number of concurrent sessions for a given user which might create the symptoms you describe.

Is there some reason why users are sharing auth credentials? Is there some reason they’re not using domain auth credentials?
Usually I would be concerned about security. However, this specific server running Samba is on a LAN for in-house use only. It isn't accessible from the internet. So we don't have the concern of who owns what file since everyone needs and has access to the same thing. This problem has occurred when I'm the only user on the system so I don't think it is capacity related.

Last edited by edwardcoast; 12-02-2018 at 03:50 PM.
  #6  
Old 12-02-2018, 06:34 PM
EdelweissPirate is offline
Guest
 
Join Date: Mar 2015
Location: Portland, OR USA
Posts: 464
Quote:
Originally Posted by edwardcoast View Post
Usually I would be concerned about security. However, this specific server running Samba is on a LAN for in-house use only. It isn't accessible from the internet.
Oh! So the whole LAN is air-gapped, then? If so, why require a password at all?

Quote:
Originally Posted by edwardcoast View Post
This problem has occurred when I'm the only user on the system so I don't think it is capacity related.
How do you know you're the only user on the system if you're all sharing the same auth credentials? You may be alone in the office, but someone may have left a Finder window open or done something else that prevents their session from going stale. It's just a theory, and whether you think it's worth investigating isn't really my concern.

Two things are unclear to me: 1) why you're password-protecting the samba share in the first place, and 2) why you're waiting for the problem to happen before you set that log level. You say that it "generates a lot of data," and that's precisely the point. You must be very tight on space if you can't store the relevant samba logs. Even if your /var partition is tiny, you could write a little shell script to move the accumulated logs to a partition with more space. I mean, reading the logs is a pretty fundamental problem-solving step in situations like this.
  #7  
Old 12-02-2018, 07:53 PM
BigT's Avatar
BigT is offline
Guest
 
Join Date: Aug 2008
Location: "Hicksville", Ark.
Posts: 36,360
I've found before that, if I didn't put a password on a Samba share, some software would just not let me in.

Is it possible that moving the files to that folder would make the full path too long for one of the files? I ran into this issue before. The reason it caused problems is complicated, but it has to do with reusing file handles. I wound up adding the bold/underline part to my mount command, which fixed the issue.

Code:
USER=user PASSWD=pass mount.cifs //192.168.254.1/Users Users -o nounix,noserverino
  #8  
Old 12-02-2018, 10:35 PM
edwardcoast is offline
Guest
 
Join Date: Jan 2014
Posts: 1,132
Quote:
Originally Posted by BigT View Post
I've found before that, if I didn't put a password on a Samba share, some software would just not let me in.

Is it possible that moving the files to that folder would make the full path too long for one of the files? I ran into this issue before. The reason it caused problems is complicated, but it has to do with reusing file handles. I wound up adding the bold/underline part to my mount command, which fixed the issue.

Code:
USER=user PASSWD=pass mount.cifs //192.168.254.1/Users Users -o nounix,noserverino
Thanks, interesting. I will have to pay attention to the file/folder length to see if that's part of the pattern to the problem occurring.

Was this problem you had with a Mac running a Samba client to connect to a Linux Samba server?

Last edited by edwardcoast; 12-02-2018 at 10:36 PM.
Reply

Bookmarks

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

Forum Jump


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

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.

Send questions for Cecil Adams to: cecil@straightdope.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Copyright 2018 STM Reader, LLC.

 
Copyright © 2017