New Problem with Samba on centos 7...

Issues related to configuring your network
Post Reply
JPC-Joe
Posts: 2
Joined: 2023/05/16 09:48:48

New Problem with Samba on centos 7...

Post by JPC-Joe » 2023/05/16 10:15:21

Dear Sirs and Ladies,

I know that this topic has already been discussed several times. More or less successfully. All the topics that I have been able to find on the net so far have not brought me a solution.

I installed a new virtual machine with CentOS 7 (console only)
- Samba, SSH and Samba-common are installed
- Test user smbuser created and activated
- Created group sambashare and assigned test user
- Directory "/data/exchange" and "/media/exchange" created
- Authorized to "exchange" is "smbuser:sambashare" with authorization 2770
- In the smb.conf a share "exchange" created
- Firewall exceptions are generated and active
- the Samba server is also accessible
- Share can also be connected to a client
- As soon as the share is accessed (read/write), the error message "No authorization" appears

See excerpt from smb.conf at the end.
The same Samba configuration runs flawlessly under a Debian.

Who can give me a tip / help where the error is.

###############################################################################################

Hallo an alle,

Ich weiss, dass dieses Thema bereits mehrmals behandelt wurde. Mal mehr oder weniger mit Erfolg. Alle Themen, die ich bislang im Netz finden konnte brachten für mich keine Lösung.

Ich habe einen neuen Virtuellen Rechner mit CentOS 7 installiert (nur Console)
- Samba, SSH und Samba-common sind installiert
- Testbenutzer smbuser angelegt und aktiviert
- Gruppe sambashare angelegt und Testbenutzer zugewiesen
- Verzeichnis "/data/austausch" und "/media/austausch" erzeugt
- Berechtigt jew. auf "austausch" ist "smbuser:sambashare" mit der Berechtigung 2770
- In der smb.conf einen share "austausch" erzeugt
- Firewall Ausnahmen sind erzeugt und aktiv
- der Samba Server ist auch erreichbar
- Share kann an einem Client auch verbunden werden
- Sobald ein Zugriff (Lese/Schreiben) auf den Share erfolgt, kommt die Fehlermeldung "Keine Berechtigung"

Auszug aus smb.conf siehe am Ende.
Die gleiche Samba Konfiguration läuft unter einem Debian einwandfrei.

Wer kann mir hier einen Tipp/Hilfe geben, wo der Fehler ist.

##############################################################################################

Code: Select all

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
   workgroup = jpc
   server string = Samba Server Version %v
   netbios name = srv01
   log file = /var/log/samba/log.%m
   max log size = 1000
   logging = file

   server role = standalone server
   obey pam restrictions = yes
   security = user


	

   map to guest = bad password
   passdb backend = tdbsam

#	hosts allow = 127. 192.168.123.
   guest ok = yes

#	printing = cups
#	printcap name = cups
#	load printers = no
#	cups options = raw
#	client min protocol = SMB2

[homes]
   comment = Home Directories
   browseable = no
   read only = no
   create mask = 0750
   directory mask = 0700
   valid users = %S

[austausch]
#	valid users = smbuser
   comment = Austausch
   path = /media/austausch
#	force user = smbuser
#	force group = smbuser
#	read only = No
   writable = yes
   guest ok = Yes
   public = yes
#	create mask = 777
#	force create mode = 777
#	directory mask = 777
#	force directory mode = 777

User avatar
TrevorH
Site Admin
Posts: 33270
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: New Problem with Samba on centos 7...

Post by TrevorH » 2023/05/16 11:25:26

Run setenforce 0 as root to put selinux into permissive mode. Try to access the share. If it works then read the contents of /etc/samba/smb.conf.example and do the things it suggests. Once done, run setenforce 1 to go back to enforcing mode and try again. Hopefully now it works.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

JPC-Joe
Posts: 2
Joined: 2023/05/16 09:48:48

Re: New Problem with Samba on centos 7...

Post by JPC-Joe » 2023/05/16 15:10:11

Hi TrevorH,

thank you for your post. That was the solution.

Two Cammands on the Server was missing:

1. chcon -t samba_share_t /path/to/directory
2. setsebool -P samba_export_all_rw on

After this changes, it work's...

Bye

Post Reply