[FIX]Samba and windows No rights

Issues related to configuring your network
Post Reply
ZossoWosso
Posts: 7
Joined: 2019/09/22 00:27:33

[FIX]Samba and windows No rights

Post by ZossoWosso » 2019/09/22 02:26:48

Good morning all

I start under Centos 7 for the moment everything is fine, this time I would like to stay in Linux
hey... I'm not at my first attempt.

Well, I'm trying to share files from Linux to Windows 7 it does not work very well
I followed this tutorial https://lintut.com/easy-samba-installat ... -centos-7/
sharing / samba / anonymous / to windows it works fine but i had to change this command
chmod -R 0755 anonymous / for chmod -R 777 anonymous / I do not know if it's ok but it works !!

but no way to share a folder in my Documents for example (/ home / Zosso / Documents/Partage) or on another hard drive (from Windows in ntsf?)
/ run / media / Zosso / 3d_Pojets / _Projet_3D

I see them well under Windows but I do not have access ???

this command chcon -t samba_share_t to / run / media / Zosso / 3d_Pojets / _Projet_3D gives me errors
root@Centos-PC _Projet_3D]# chcon -t samba_share_t /run/media/Zosso/3d_Pojets/_Projet_3D
chcon: impossible de modifier le contexte de « /run/media/Zosso/3d_Pojets/_Projet_3D » à « system_u:object_r:samba_share_t:s0 »: Opération non supportée
[root@Centos-PC _Projet_3D]#
I have a hard drive For Linux and 4 others to save my projects on Windows
should i change the ntsf for linux partition ???

I hope I was clear enough

thank you



smb.conf
global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = centos-PC
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================
[Anonymous]
path = /samba/anonymous
browsable =yes
writable = yes
guest ok = yes
read only = no

[Partage]
path = /home/Zosso/Documents/Partage
browsable =yes
writable = yes
guest ok = yes
read only = no

[_Pojets_Maya]
path = /run/media/Zosso/3d_Pojets/_Projet_3D/_Pojets_Maya
browsable =yes
writable = yes
guest ok = yes
read only = no
Image
Last edited by ZossoWosso on 2019/09/25 21:20:48, edited 1 time in total.

ZossoWosso
Posts: 7
Joined: 2019/09/22 00:27:33

Re: Samba and windows No rights

Post by ZossoWosso » 2019/09/22 18:25:11

Hello again
it looks like everything in the / samba directory

I can share it well.

but folders in Documents for example I can not do it
or mounted disk ??

no track ??


thank you.

hunter86_bg
Posts: 1912
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Samba and windows No rights

Post by hunter86_bg » 2019/09/23 13:10:14

Most probably your SELINUX is preventing that.
To verify that , use the '-Z' flag:

Code: Select all

ls -lZ
The simpler approach is to copy the files to your /samba dir and test.
Another approach is to mount via 'bind/rbind' options and specifiying the selinux context:

Code: Select all

mount -o rbind,context="system_u:object_r:samba_share_t"   /home/user/Directory-to-share /samba/Directory-to-share
And try again.

Edit: chcon is not the permanent approach to change SELINUX labels . Check 'semanage fcontext -a' for proper setup.

ZossoWosso
Posts: 7
Joined: 2019/09/22 00:27:33

Re: Samba and windows No rights

Post by ZossoWosso » 2019/09/23 20:17:34

NUIL
Last edited by ZossoWosso on 2019/09/24 00:15:26, edited 1 time in total.

ZossoWosso
Posts: 7
Joined: 2019/09/22 00:27:33

Re: Samba and windows No rights

Post by ZossoWosso » 2019/09/23 21:18:02

Most probably your SELINUX is preventing that.
To verify that , use the '-Z' flag:
ls -lZ
Hello hunter86_bg



ok for those directory i reactivate SELINUX permissive

[root@Centos-PC samba]# ls -lZ
drwxrwxrwx. nobody nobody unconfined_u:object_r:samba_share_t:s0 anonymous
drwxrwxrwx. root root system_u:object_r:samba_share_t:s0 secured
drwxrwxrwx. nobody nobody system_u:object_r:samba_share_t:s0 vfx
[root@Centos-PC samba]#


But not working again ???? can't edit files

[root@Centos-PC VFX]# ls -lZ
drwxr-xr-x. Zosso Zosso system_u:object_r:dosfs_t:s0 Workgroup
[root@Centos-PC VFX]#

Workgroup is a directory on mounted drive /run/media/Zosso/VFX

i can't change

dosfs_t to samba_share_t

EX : chcon -t samba_share_t /Workgroup

any idea...

thank you

ZossoWosso
Posts: 7
Joined: 2019/09/22 00:27:33

Re: Samba and windows No rights

Post by ZossoWosso » 2019/09/24 21:44:20

Hello

Now it works for the file in / samba.

this function is ok (chcon -t samba_share_t)

but I have to mount a hard drive and I can not
use this function (chcon -t samba_share_t)

error:
chcon: Unable to change context from "Workgroup /" to "system_u: object_r: samba_share_t: s0": Operation not supported


think everything goes under SELinux

here there is info but it is not my language it is difficult to understand

https://access.redhat.com/documentation ... uide/index

Thank you

ZossoWosso
Posts: 7
Joined: 2019/09/22 00:27:33

Re: [FIX]Samba and windows No rights

Post by ZossoWosso » 2019/09/25 21:22:16

hallo

fixed
all this for a disk format in fat32.
i format it in ntsf and everything is ok

Post Reply

Return to “CentOS 7 - Networking Support”