LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Ubuntu1604 Samba File permission issue (https://www.linuxquestions.org/questions/linux-server-73/ubuntu1604-samba-file-permission-issue-4175595589/)

BirdfromtheSouthpole 12-16-2016 02:51 PM

Ubuntu1604 Samba File permission issue
 
Hello everyone,

I've a small issue with my lab at home and samba.
I use a Ubuntu 1604 Server in a VM Workstation environment, installed Samba and performed a basic config.
However, let me first explain what issue I have, before I come to the details.

Under /srv there is a "testshare" folder with an overall permission of 777, inside of it, I touched some txt as root. Those files are all owned by root, no one else. So, when I remote connect to my mounted samba share as a regular user (with username/password)and the bash, I only can see those root files, not edit them...ok, logical and all perfect.
BUT, when I use a file explorer like files or nautilus, or even the MS Windows Explorer,...I can edit all root files.
The ownership changes immediately to the users name. Same with a remote PowerShell. The difference is, that I use the CIFS Path //server/share notation instead of mounting the path.

Seems that file permissions only work by mounting it like mount -t CIFS etc.

How can I change it, so that file permission get inherited?

My smb.conf looks like this

[global]
security=user

[testshare]
comment=blabla
path=/srv/testshare
readonly=no
inherit acls=yes
browseable=yes
guest ok=no


I highly appreciate any information to it, I read the readhat and ubuntu manuals and some other sources, and I feel I missed something essential. I'm not new to linux nor IT stuff...but samba is.

Ratamahatta 12-16-2016 05:43 PM

I guess for permissions on just some (and not all) files I'd try to use the 'force user' option on the share (and set it to some less privileged user). Maybe that will make sure root's files remain untouched?
Do you think this approach is applicable?

c0wb0y 12-17-2016 02:27 AM

Quote:

Under /srv there is a "testshare" folder with an overall permission of 777, inside of it, I touched some txt as root. Those files are all owned by root, no one else. So, when I remote connect to my mounted samba share as a regular user (with username/password)and the bash, I only can see those root files, not edit them...ok, logical and all perfect.
Did you try editing them? I supposed you should be able to edit them no problem because of very relaxed permission.


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