GNU/Linux >> Tutoriels Linux >  >> Ubuntu

Comment accorder des autorisations d'écriture dans Samba ?

J'ai des problèmes avec les autorisations de lecture/écriture sur mon serveur Samba, comment puis-je corriger mon fichier smb.conf et les autorisations de fichiers pour avoir un accès plus unifié ?

smb.conf

[global]
workgroup = workgroup
netbios name = LnxNAS
server string = %h
wins support = no
dns proxy = no
security = user
encrypt passwords = yes
panic action = /usr/share/samba/panic-action %d

[homes]
comment = Home Directories

[Video]
path = /data/eric/Videos

[Music]
path = /data/eric/Music

[Pictures]
path = /data/eric/Pictures

[data]
path = /data
writeable = Yes

mon ls -l de /data/eric/Pictures

drwxrwxrwx 2 ericfoss root     4096 2011-03-13 22:09 Android Projs
drwxrwxrwx 3 ericfoss root     4096 2011-03-13 22:09 Automotive
-rwxrwxrwx 1 ericfoss root     2439 2010-12-17 17:03 BDD reduction.png
-rwxrwxrwx 1 ericfoss root     2722 2010-12-17 16:55 BDD Tree.png
-rwxrwxrwx 1 ericfoss root     7341 2010-12-17 16:46 BDD Tree.xcf
-rwxrwxrwx 1 ericfoss root    72421 2007-11-22 22:59 Bum Ninja.jpg
-rwxrwxrwx 1 ericfoss root    32152 2010-12-17 21:25 cell transition.png
-rwxrwxrwx 1 ericfoss root    40212 2010-12-17 17:55 control graph.png
drwxrwxrwx 2 ericfoss root     4096 2011-03-13 22:09 Crap
-rwxrwxrwx 1 ericfoss root       82 2010-09-20 17:18 desktop.ini
[email protected]:~$

Sortie du redémarrage de samba4

sudo /etc/init.d/samba4 restart
 * Stopping Samba 4 daemon samba              [ OK ]
 * Starting Samba 4 daemon samba
Unknown parameter encountered: "guest ok"
Ignoring unknown parameter "guest ok"
Unknown parameter encountered: "guest ok"
Ignoring unknown parameter "guest ok"
Unknown parameter encountered: "writeable"
Ignoring unknown parameter "writeable"
Unknown parameter encountered: "valid users"
Ignoring unknown parameter "valid users"
                                              [ OK ]

Je ne peux pas supprimer, renommer ou créer des fichiers…

Réponse acceptée :

Samba a sa propre couche de contrôle d'accès pour chaque partage. Il existe deux options de base

  • read only  :par défaut, chaque partage est en lecture seule, quelles que soient les autorisations du système de fichiers,
  • writeable  :afin d'autoriser l'accès en écriture, vous devez définir writeable = Yes .

Cela devrait suffire à résoudre le problème. Mais si vous souhaitez en savoir plus sur les autorisations Samba, comme comment définir umask, activer le compte invité ou contrôler l'accès pour des utilisateurs/groupes individuels, lisez le court didacticiel sur les autorisations Samba.


Ubuntu
  1. Comment écrire une boucle dans Bash

  2. Qu'est-ce qu'Umask et comment l'utiliser

  3. Comment activer les autorisations de fichiers Unix sur le partage Samba avec Smb 2.0+ ?

  4. Comment accéder aux partages Samba dans Lubuntu 12.10 ?

  5. Comment modifier les autorisations de fichiers sur un lecteur Fat32 ? ?

Comment installer Samba sur CentOS 8

Comment installer et configurer Samba sur Ubuntu 20.04

Comment installer Samba sur Ubuntu 20.04 LTS

Comment créer un nouvel utilisateur et accorder des autorisations dans MySQL

Comment modifier les autorisations de fichier

Comment installer Samba sur Ubuntu 20.04