Serveur d'impression

L'oreille d'or – Configurer un serveur Samba 3 avec Debian 4.0 Etch – Serveur d’impression

Par Titanfall , le 11 avril 2020 - 73 minutes de lecture

Sommaire

Contenu

introduction

Ce document décrit comment configurer un serveur à multiples facettes pour les postes de travail Windows et Unix à l'aide de Samba 3 sur un serveur Debian GNU / Linux 4.0 'Etch'. Le serveur fournit un contrôleur de domaine principal (PDC) de style Windows NT 4, avec des profils utilisateur itinérants; fichier, impression, déploiement de logiciels (à l'aide de WPKG) et configuration des utilisateurs Windows (à l'aide du serveur TWEAK (sans assistance)); et serveur WINS. Ce n'est pas un PDC de style Active Directory.

Le fait d'avoir un contrôleur de domaine sur un réseau vous permet de définir un ensemble de comptes d'utilisateurs.
Lorsqu'elles sont activées, les stations de travail Windows présentent une invite de connexion permettant aux utilisateurs de se connecter au domaine avec l'un de ces comptes d'utilisateur sur n'importe quelle machine.

Les profils utilisateur itinérants fournissent le même profil Windows aux utilisateurs pour chaque compte, quelle que soit la machine sur laquelle ils se connectent. Le profil Windows comprend la personnalisation de leur administrateur système ou celle de leur administrateur Windows, leur bureau et les raccourcis du menu Démarrer, etc.

Les utilisateurs ont accès à un répertoire d'accueil privé et à un nombre illimité de répertoires partagés entre certains ou tous les autres utilisateurs.

Les imprimantes sont configurées une seule fois et disponibles pour tous les utilisateurs.

Pour d'autres options de serveur Debian, voir 'Configuration du serveur avec Debian 4.0' Etch ''.

Ce guide ne fournit pas de chemin de mise à niveau depuis notre contrôleur de domaine Samba 2.2 sur le document Debian 3.0 Woody, disponible à http://thegoldenear.org/toolbox/unices/samba/samba-setup.html. Ce guide suppose que vous installez à partir de zéro.

Modifications notables apportées à ce document

1.2.0 – 5 décembre 2013

  • NETLOGON.BAT (script d'ouverture de session) 2.2.0 – ajouter une section de gestion pour supprimer les répertoires de profil Windows laissés par les applications logicielles que nous n'utilisons plus.
  • Configurer WPKG – supprimer WPKG's 'hôtes' et 'profils'répertoires afin que les exemples de fichiers XML ne soient pas traités au démarrage de chaque poste de travail

1.1.0 – 13 mai 2013

  • NETLOGON.BAT (script de connexion) 2.1.0 – % USERPROFILE% Start Menu Programs startup desktop.ini, qui est créé en définissant un mode d'affichage dans l'Explorateur Windows, combiné avec la définition .ini fichiers à ouvrir dans un éditeur de texte, provoque desktop.ini à ouvrir dans l'éditeur de texte lors de la connexion pour certaines personnes. Supprimez donc certains desktop.ini fichiers au lieu de les cacher
  • Lorsque vous copiez un outil Windows existant, ou une installation WPKG, un répertoire à partir d'un autre serveur, définissez également le propriétaire du groupe sur samba-domain-admins
  • Ajout d'une note dans la section Maintenance pour noter le SID du domaine au cas où il changerait pour une raison quelconque.

1.0.0 – 19 mars 2010

  • NETLOGON.BAT (script d'ouverture de session) 2.0.0 – utilise TWEAK (sans assistance) pour fournir une infrastructure pour déployer automatiquement la configuration utilisateur.
  • netlogon.bat 1.1 avait un problème où le commentaire: pour la zone partagée pour tout le monde dans le groupe de personnel 'a raté le''et la commande' net use LPT1: "\ SERVER "'raté le'"
  • De même, le commentaire en haut de smb.conf vous demandant de remplacer «» par le nom de votre organisation, aurait dû lire «".

0.9.7 – 29 juin 2009

0.9.6 – 24 avril 2009

  • smb.conf 0.7.2 – Ajout d'une section d'impression avec printcap name = / dev / null et charger des imprimantes = non pour désactiver explicitement l'impression. Sans cela / var / log / samba / syslog et /var/log/samba/log.smbd sont pleins de messages de printing / pcap.c: pcap_cache_reload (159) Impossible d'ouvrir le fichier printcap / etc / printcap pour lecture!. Si vous utilisez réellement un serveur d'impression, vous ne le souhaitez pas, mais plutôt la configuration du serveur d'impression dans la section Impression.
  • smb.conf 0.7.1 – Suppression de "case de conservation = oui" et de "case de conservation courte = oui" comme valeur par défaut sur oui. Il s'agit d'un changement cosmétique, car les laisser ou les retirer ne fait aucune différence.
  • Lors de la création de sous-groupes / groupes restreints, la modification de la propriété du groupe et des autorisations du répertoire restreint a été omise (chgrp -personnel / accueil //limité et chmod 0750 / home //limité). Sans propriété du groupe, les utilisateurs ont été invités à saisir un autre nom d'utilisateur et mot de passe pour se connecter à R: lors de la connexion.
  • L'exemple de la définition de la propriété lors de la copie en masse de fichiers dans le répertoire partagé a négligé de modifier la propriété du groupe en -Personnel

0.9.3 – 6 oct 2008

  • Ajout d'instructions pour la création d'utilisateurs avec pouvoir sur les postes de travail Windows
  • Accordez à winadmin l'accès aux fichiers partagés sur S :, en utilisant adduser winadmin -Personnel

0.9.2 – 4 oct 2008 – «chmod g + ws / usr / windows-admin» de la zone d'administration de Windows était erroné car il définissait le mode d'autorisation du système de fichiers de groupe sur «wS» (inscriptible et définissait l'ID de groupe) alors que ce que nous voulions était « ws '(accessible en écriture, exécutable et définir l'ID de groupe). Cela a empêché les personnes du groupe samba-domain-admins de se déplacer dans le répertoire / usr / windows-admin. Il aurait dû être à la place «chmod g + wxs / usr / windows-admin».

0.9.1 – 23 septembre 2008 – 'chmod g + ws, ox / usr / windows-admin' de la zone d'administration Windows ne permettait pas au compte winuser de WPKG d'accéder aux packages pour l'installation automatique, il a donc été changé en 'chmod g + ws / usr / windows -admin '. Pour corriger un répertoire déjà défini, utilisez 'chmod o + x / usr / windows-admin'.

0.9.0 – 17 juin 2008

  • Modification de l'emplacement du sous-groupe restreint depuis / home // à la maison//limité/. Cela évolue mieux, lorsque vous avez un certain nombre de groupes, au lieu d'une lettre de lecteur pour chacun, nous avons maintenant R: pour tous.
  • Suppression de l'autorisation d'exécution pour les autres sur / usr / windows-admin
  • Créez un répertoire pour le clonage des postes de travail dans / usr / windows-admin / images
  • winadmin est capable de rejoindre un domaine qui n'était pas possible avec Debian 3.1 Sarge
  • Ajout de la création d'un compte winuser à des fins de test
  • En collaboration avec smb.conf [programs] changer, sous Unix, définir 2774 sur / usr / windows-programmes plutôt que 2775
  • smb.conf version 0.7.0:
    • Modification de l'emplacement du sous-groupe restreint depuis / home // à la maison//limité/. Ajouté (commenté) correspondant [restricted] partager. Cela évolue mieux, lorsque vous avez un certain nombre de groupes, au lieu d'une lettre de lecteur pour chacun, nous avons maintenant R: pour tous.
    • Commenté [programs] parce que nous ne l'utilisons pas; ajout du «mode de création forcée = 0664» et du «mode répertoire de force = 2774»
    • Exemple de linpopup mis en commentaire supprimé
    • Ajout de la liste d'écriture = @-personnel à [shared] (identique aux autorisations Unix)
    • Supprimé [netlogon] 'inscriptible = oui'. Il était redondant car la valeur par défaut est «lecture seule = oui» et nous la remplaçons pour certaines personnes avec «write list = @ samba-domain-admins»
    • Échangé [homes] 'inscriptible = oui' pour 'lecture seule = non' qui signifie la même chose
  • NETLOGON.BAT version 1.0.0
    • 1.0.0: Ajouté (commenté) R: pour \ SERVER restricted
    • 0.9.1: correction pour Windows XP créant des fichiers desktop.ini, en particulier celui de démarrage
    • 0.9.0:
      • Commenté P: car c'est utile mais nous ne l'utilisons pas actuellement
      • Suppression de la création de D: winnt qui était obsolète depuis longtemps
      • Supprimez la création de D: mozilla car nous utilisons de nos jours Firefox
      • Création de D: nero remplacée par D: infrarecorder
  • La section smb.conf a dit à tort que le fichier de configuration de Samba était /etc/smb.conf plutôt que /etc/samba/smb.conf (quelle énorme gaffe!)

0.8.8 – 4 mars 2008

  • [windows-admin] Le partage smb.conf est apparu dans les sections «smb.conf» et «Zone d'administration Windows». Apparaît maintenant uniquement dans la section «Zone d'administration Windows».
  • La section 'Zone d'administration Windows' avait 'forcer le mode répertoire = 0660' alors que la section 'smb.conf' avait 'forcer le mode répertoire = 2770'. La section «Zone d'administration Windows» a désormais «forcer le mode répertoire = 2770».

Changements par rapport au guide précédent

  • La «conversation passwd» de smb.conf est passée de «* Entrez snew sUNIX spassword: *% n n * Retapez snew sUNIX spassword: *% n n». à '* Entrez snew sUNIX spassword: *% n n * Retapez snew sUNIX spassword: *% n n * password supdated ssuccessfully *.'
  • 'net groupmap modify' est maintenant 'net groupmap add'; en outre, le RID doit être spécifié, en utilisant la forme «rid = 512»
  • Avec Debian 4.0 'Etch', les administrateurs de domaine peuvent joindre un poste de travail à un domaine, vous n'êtes plus lié à utiliser uniquement le compte root pour cela

Un peu de théorie de Samba 3

Utilisateurs, droits, groupes et identifiants relatifs à l'administration du domaine

"Lors de leur première installation, Microsoft Windows NT4 / 200x / XP est préconfiguré avec certaines entités Utilisateur, Groupe et Alias. Chacune a un identificateur relatif (RID) bien connu.
Ceux-ci doivent être préservés pour une intégrité de fonctionnement continue. Samba doit être approvisionné avec certains groupes de domaines essentiels qui nécessitent la valeur RID appropriée.
Lorsque Samba-3 est configuré pour utiliser tdbsam, les groupes de domaines essentiels sont automatiquement créés. Il est de la responsabilité des administrateurs LDAP de créer (provisionner) le
Groupes NT par défaut. "
– «Chapitre 12. Mappage de groupe: MS Windows et UNIX – Configuration avancée»:
http://www.samba.org/samba/docs/man/Samba3-HOWTO/groupmapping.html

"Assurez-vous de mapper chacun [Windows] Groupe de domaines vers un groupe système UNIX. C'est le seul moyen de garantir que le groupe sera disponible pour une utilisation en tant que groupe de domaine NT. "

Entité bien connue DÉBARRASSER SID Notre groupe Unix Type domaine / local / intégré Objectif Indispensable pour Samba?
Administrateurs de domaine 512 S-1-5--512 administrateurs de domaine samba Groupe domaine "Un groupe global dont les membres sont autorisés à administrer le domaine. Par défaut, le groupe Administrateurs de domaine est membre du groupe Administrateurs sur tous les ordinateurs qui ont rejoint un domaine, y compris les contrôleurs de domaine. Les administrateurs de domaine sont le propriétaire par défaut de tout objet qui est créé par n'importe quel membre du groupe. Oui
Utilisateurs du domaine 513 S-1-5--513 utilisateurs du domaine samba Groupe domaine "Un groupe global qui, par défaut, inclut tous les comptes d'utilisateurs d'un domaine. Lorsque vous créez un utilisateur
compte dans un domaine, il est ajouté à ce groupe par défaut. "
Oui
Invités du domaine 514 S-1-5--514 samba-domain-invites Groupe domaine "Un groupe global qui, par défaut, n'a qu'un seul membre, le compte invité intégré du domaine." Oui
Opérateurs d'impression intégrés 550 S-1-5-32-550 lpadmin Alias intégré gérer les imprimantes et les files d'attente de documents; impossible d'ajouter des imprimantes Non

Déléguez les privilèges administratifs nécessaires à un utilisateur normal ou à des groupes d'utilisateurs. Par défaut, aucun privilège ni droit n'est attribué.
Ils doivent être créés manuellement.

le smb.conf paramètre qui se rapporte à cela est activer les privilèges = oui.

Privilèges disponibles

"L'équipe Samba n'implémente que les privilèges logiques et utiles sous UNIX / Linux
environnement. De nombreux privilèges Windows 200X / XP n'ont pas d'équivalence directe sous UNIX. "
Samba dispose de ces privilèges que nous pouvons utiliser:

SeAddUsersPrivilege
"Ce droit détermine si smbd permettra ou non à l'utilisateur de créer de nouveaux comptes d'utilisateurs ou de groupes via des outils tels que l'ajout d'utilisateurs net rpc ou le gestionnaire d'utilisateurs NT4 pour les domaines."

SeDiskOperatorPrivilege
"Les comptes qui possèdent ce droit pourront exécuter des scripts définis par la commande add / delete / change share dans le fichier smb.conf en tant que root. Ces utilisateurs pourront également modifier la liste de contrôle d'accès associée aux partages de fichiers sur le serveur Samba."

SeMachineAccountPrivilege
"Ce droit contrôle si l'utilisateur peut ou non joindre des machines clientes à un domaine contrôlé par Samba."

SePrintOperatorPrivilege
"Ce privilège fonctionne de manière identique à l'option d'administration de l'imprimante dans le fichier smb.conf (voir la section 5 de la page de manuel pour smb.conf), sauf qu'il s'agit d'un droit global (pas sur une base par imprimante). Finalement, l'option smb.conf seront dépréciés et les droits administratifs sur les imprimantes seront contrôlés exclusivement par ce droit et la sécurité
descripteur associé à l'objet imprimante dans le fichier ntprinters.tdb. "

SeRemoteShutdownPrivilege
"Samba fournit deux crochets pour arrêter ou redémarrer le serveur et pour abandonner une commande d'arrêt précédemment émise. Comme il s'agit d'une opération normalement limitée par
le système d'exploitation à l'utilisateur root, un compte doit posséder ce droit pour pouvoir exécuter l'un de ces hooks. "

SeTakeOwnershipPrivilege
Ce droit permet aux utilisateurs de s'approprier des fichiers et des répertoires.

Lectures complémentaires

Guide officiel et guide de référence Samba-3 – Chapitre 12. Mappage de groupe: MS Windows et UNIX:
http://samba.org/samba/docs/man/Samba-HOWTO-Collection/groupmapping.html.

Guide officiel et guide de référence Samba-3 – Chapitre 13. Gestion à distance et locale:
http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/NetCommand.html#id2572033

Guide officiel et guide de référence Samba-3 – Chapitre 15. Droits et privilèges des utilisateurs:
http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/rights.html

Identificateurs de sécurité bien connus dans les systèmes d'exploitation Windows
http://support.microsoft.com/kb/243330.

Création de comptes d'utilisateurs

La syntaxe de création d'un compte utilisateur est la suivante:
net rpc user add -S -U

La syntaxe pour définir un mot de passe pour le compte d'utilisateur est la suivante:
mot de passe utilisateur net rpc ""-U

Notez que la commande net peut être utilisée depuis n'importe quelle machine Unix, pas seulement depuis la console du serveur Samba,
en incluant l'option -S

(et également à partir de n'importe quelle ligne de commande Windows avec une syntaxe légèrement différente)

GAGNE

Lorsque NetBIOS sur TCP / IP est activé sur le client, un serveur WINS est fortement recommandé pour faciliter la résolution des noms NetBIOS (SMB) en adresses IP. Nous faisons du serveur Samba le serveur WINS, grâce à l'utilisation des paramètres smb.conf remporte le soutien et nom résoudre l'ordre. Vous ne devez l'utiliser que s'il s'agit du seul serveur WINS; s'il y a des serveurs Windows, choisissez plutôt l'un d'eux comme serveur WINS.

WINS est le seul moyen de résolution de noms pour les clients NetBIOS sur différents sous-réseaux.

Sur le client, vous devez définir l'adresse du serveur WINS et désactiver LMHOSTS dans la section des propriétés TCP / IP.

<! –

Matériel

Quel type de serveur recommanderiez-vous grosso modo?
Pour 10 utilisateurs?

Domaines à améliorer pour des performances accrues:
réseau (câblage, commutateurs, cartes réseau)
disques durs du serveur
– taux de transfert
– SCSI ou SATA plutôt que ATA / PATA / IDE
CPU du serveur ->

Partitions de disque

Ces tailles de partition sont pour les sections qui diffèrent de nos tailles de partition de serveur standard comme
décrit dans notre document serveur Debian respectif.

Étiquette Taille Point de montage Usage
usr 5 Go – 7 Go (pour la suite logicielle RCS) / usr packages logiciels pour le déploiement, éventuellement Windows pour le déploiement, correcteurs automatiques, tous les programmes Windows exécutés à partir du serveur. Si vous y mettez des choses comme Adobe CS, vous voudrez peut-être encore plus d'espace.
maison tout ce qui est approprié /domicile Répertoires personnels des utilisateurs (H :); répertoire partagé de l'organisation (S :); répertoire restreint de l'organisation (R :); Profils d'utilisateurs Windows (y compris les bureaux d'utilisateurs); email

Le contrôleur de domaine Samba

Paquets

  • Samba 3.0.24
    • samba
    • samba-doc
    • smbclient
  • flip – convertit les fins de ligne de fichier texte entre les formats de nouvelle ligne Unix et DOS. Obligatoire pour le script d'ouverture de session, NETLOGON.BAT.

Installez-les avec cette commande: aptitude install samba samba-doc smbclient flip.

Fichier de configuration Samba (smb.conf)

smb.conf

Remplacer le fichier de configuration Samba existant /etc/samba/smb.conf avec ça:




# ================================================= ==============
# smb.conf
# Fichier de configuration Samba 3.0.24 pour le contrôleur de domaine principal
# (PDC), serveur d'impression et de domaine fonctionnant sur Debian 4.0 Etch.
#
# http://thegoldenear.org/toolbox/unices/
#
# Licence: GNU General Public License version 3 ou ultérieure
#
# Version: 0.8.0
# Pour l'explication et le changelog voir
# http://thegoldenear.org/toolbox/unices/samba-3-pdc-print-server-debian-etch.html#smb.conf
# ================================================= ==============

# ================================================= ==============
# REMARQUE:
# - Après la modification, exécutez «testparm» pour vérifier les erreurs.
# - Remplacer ''avec le nom de votre organisation actuelle.
# - Décommentez certains des exemples de partages si vous souhaitez les utiliser.
# ================================================= ==============


# ======================= Paramètres globaux ========================

[global]

## Navigation / Identification ###

# Remplacez-le par le nom de groupe de travail / domaine NT dont votre serveur Samba fera partie
# (Notez qu'il y a une longueur maximale à cela, quelque part 


Modifiez les éléments suivants dans smb.conf en fonction de votre situation:

  • Remplacer "'avec votre propre nom d'organisation.
  • Utiliser [programs], [database] ou [restricted] partage puis décommentez-les.
  • Pour configurer un serveur d'impression, puis commentez 'nom du capuchon d'impression' et 'charger des imprimantes'et ajoutez les smb.conf paramètres de la section smb.conf Additions for Printer Serving.
  • Pour ajouter une zone d'outils pour l'administration Windows, comme WPKG, puis ajoutez les smb.conf paramètres de la section Administration de Windows.

Vérifiez que vous n'avez aucune erreur syntaxique:
testparm

Redémarrez Samba:
/etc/init.d/samba restart

smb.conf Changelog

  • 0.8.0 – 26 juin 2009 – ajouté [database] partager avec OpLocks désactivé pour l'intégrité des données lors du partage de fichiers de base de données entre plusieurs utilisateurs
  • 0.7.2 – 24 avril 2009 – Ajout d'une section d'impression avec 'printcap name = / dev / null' et 'load printers = no' pour désactiver explicitement l'impression, sinon obtenez les messages 'Impossible d'ouvrir le fichier printcap' dans le journal.
  • 0.7.1 – 21 janvier 2009 – Suppression de «cas de conservation = oui» et de «cas de conservation court = oui», les deux par défaut à oui
  • 0.7.0 – 17 juin 2008
    • Modification de l'emplacement du sous-groupe restreint depuis / home // à
      /domicile//limité/. Ajout (commenté) du smb.conf correspondant [restricted] partager. Ajouté (commenté) NETLOGON.BAT R correspondant: pour \ SERVER restreint. Cela évolue mieux, lorsque vous avez un certain nombre de groupes, au lieu d'une lettre de lecteur pour chacun, nous avons maintenant R: pour tous.
    • Commenté [programs] parce que nous ne l'utilisons pas; ajout du «mode de création forcée = 0664» et
      'forcer le mode répertoire = 2774'
    • Exemple de linpopup mis en commentaire supprimé
    • Ajout de la liste d'écriture = @-personnel à [shared] (identique aux autorisations Unix)
    • Supprimé [netlogon] 'inscriptible = oui'. Il était redondant car la valeur par défaut est «lecture seule = oui» et nous la remplaçons pour certaines personnes avec «write list = @ samba-domain-admins»
    • Échangé [homes] 'inscriptible = oui' pour 'lecture seule = non' qui signifie la même chose
  • 0.6.4 – 4 mars 2008 – [windows-admin] supprimé, nécessite désormais d'ajouter séparément
  • 0.6.3 – 27 septembre 2007 – a commenté 'invalid users = root', ce que nous avons recommandé de toute façon, car nous n'avons pas réussi à faire fonctionner le compte winadmin à la place
  • 0.6.2 – 16 août 2007 – Suppression de '-r' de 'delete user script' afin que lorsqu'un compte d'utilisateur soit supprimé, les fichiers du répertoire personnel de l'utilisateur ne soient pas supprimés
  • 0.6.1 – 22 juillet 2007
    • Supprimé "[install]'pour Unattended car il est redondant
    • 'Chaîne de serveur' remplacée de 'Contrôleur de domaine principal Samba' par 'Contrôleur de domaine'

Activer l'accès root

Activez le compte Samba pour root et donnez-lui un mot de passe lorsque vous y êtes invité:
smbpasswd -e racine

Compte d'ordinateur

Ajoutez un groupe dans lequel de nouvelles machines sont ajoutées:
machines addgroup

Droits, groupes et identificateurs relatifs

Si vous le souhaitez, vous pouvez créer un compte d'administrateur de domaine (c'est-à-dire faire de root l'administrateur) mais vous n'en avez pas besoin, nous créons plutôt des groupes d'administration de domaine. Si vous le vouliez, vous le feriez de cette façon:

Créez des groupes Unix (vous ne pouvez pas refléter les noms utilisés par Windows car nous ne pouvons pas créer de groupes avec des espaces dans leurs noms):
addgroup --gid 512 "samba-domain-admins"
addgroup --gid 513 "samba-domain-users"
addgroup --gid 514 "samba-domain-invites"

Mappez ces groupes aux groupes Windows respectifs qui existent déjà dans cette version de Samba:
net groupmap add rid = 512 ntgroup = "Domain Admins" unixgroup = "samba-domain-admins" type = domain -U root
net groupmap add rid = 513 ntgroup = "Domain Users" unixgroup = "samba-domain-users" type = domain -U root
net groupmap add rid = 514 ntgroup = "Domain Guests" unixgroup = "samba-domain-invites" type = domain -U root
(À FAIRE: les invités de domaine devraient-ils être unixgroup = "personne"?]

Attribuez les privilèges appropriés à ces groupes – nous le faisons ici uniquement pour les administrateurs de domaine, les opérateurs d'impression sont définis dans la section d'impression plus tard:
octroi de droits rpc nets "Administrateurs de domaine"
SeMachineAccountPrivilege
SePrintOperatorPrivilege
SeAddUsersPrivilege
SeRemoteShutdownPrivilege
SeDiskOperatorPrivilege
-U root

Répertoires

Créez un répertoire pour contenir quelques éléments Samba:
mkdir / home / samba

Créez un répertoire pour les profils utilisateur Windows:
mkdir / home / samba / profiles
(TODO: quelles autorisations devons-nous définir?)

Créez un répertoire pour les sauvegardes des profils utilisateur Windows et définissez des autorisations afin que personne, à l'exception du propriétaire et des membres du groupe samba-domain-admins, puisse y accéder pour des raisons de confidentialité:
mkdir / home / samba / profiles-backup
chgrp samba-domain-admins / home / samba / profiles-backup
chmod 770 / home / samba / profiles-backup

Répertoire partagé pour tous les membres du groupe organisationnel

Les autorisations de répertoire concernent l'accès à ce répertoire, ce qu'une personne peut y faire, pas la définition des autorisations / fichiers créés dans celui-ci (à l'exception de setuid, setgid et sticky bit, qui concernent l'application d'un paramètre particulier et sont hérités) . Contrairement au système basé sur ACL de Windows, les autorisations Unix ne sont pas héritées d'un répertoire à l'autre – vous ne pouvez pas les utiliser pour définir que les nouveaux fichiers ont des autorisations r, w ou x particulières – les autorisations à affecter sont déterminées à la place à l'aide de la 'umask'.

L'umask définit les autorisations qu'un nouveau fichier obtiendra, ou mieux, les autorisations qu'il n'obtiendra pas. L'umask par défaut de Debian pour root est 0077, ce qui entraîne des autorisations de fichier par défaut de 600 (rw ——-) et une autorisation de répertoire par défaut de 700 (rwx ——). L'umask par défaut de Debian pour les autres utilisateurs est 0022, ce qui entraîne des autorisations de fichier par défaut de 644 (rw-r – r–) et une autorisation de répertoire par défaut de 755 (rwxr-xr-x)

Samba est capable de fournir l'héritage de sorte que tous les fichiers / répertoires créés dans / accueil / samba à partir de Windows via Samba aura des autorisations déterminées par smb.confc'est [shared] sections forcer le mode de création = 0660 et forcer le mode répertoire = 2770 (qui sont définis pour refléter ceux définis ici). Les fichiers / répertoires créés ici depuis Unix, plutôt que via Samba, verront leurs autorisations définies par umask et vous obligeront donc à définir manuellement leurs autorisations explicitement, voir la boîte d'informations distinctes.

Créez un groupe d'organisation pour partager des fichiers entre tous les employés:
# ajouter un groupe -Personnel

Créez un répertoire dans lequel vous allez créer d'autres répertoires partagés pour les personnes au sein de l'organisation:
# mkdir / home /

Créez un répertoire pour les fichiers partagés entre tous les membres de l'organisation (un S: pour les membres du groupe d'employés de l'organisation):
# mkdir / home //partagé

Nous changeons le propriétaire du répertoire partagé en winadmin plus tard, lorsque nous avons créé cet utilisateur.

Remplacez le groupe du répertoire partagé par le groupe d'organisation:
# chgrp -personnel / accueil //partagé

Modifiez les autorisations sur le répertoire partagé de sorte que:

  • Soit winadmin, soit n'importe qui dans le groupe d'organisation, mais personne d'autre, peut accéder au répertoire, y voir les fichiers et sous-répertoires et modifier le contenu (créer, supprimer, changer et renommer)
  • La propriété de groupe des nouveaux fichiers / répertoires créés ici sera automatiquement définie sur le même groupe que ce répertoire, le groupe d'organisation (tel que défini par set group id / setgid / SGID), et que ce paramètre, contrairement aux autres, sera hérité par sub -répertoire.

# chmod 2770 / home //partagé

Problèmes de copie de fichiers existants vers partagés

Lorsque vous copiez des fichiers ici à partir d'un autre système Unix, n'oubliez pas de conserver leurs horodatages car les utilisateurs le trouvent utile. En utilisant cp, le -une switch copiera récursivement et conservera les horodatages; en utilisant scp, le -rp commutateur est similaire. De plus, plutôt que d'utiliser *, utilisez la syntaxe suivante qui copie tous les fichiers, y compris ceux commençant par un .: cp -a

Lorsque vous copiez des fichiers ici via une autre méthode que l'utilisation de l'Explorateur Windows via Samba, comme cp, scp ou un client FTP, vous devez ensuite définir des autorisations sur ces fichiers à celles que nous avons définies pour le répertoire partagé. Ce qui suit décrit comment:

Autorisations pour un seul fichier

chmod 0660 / home //partagé/

Autorisations pour plusieurs fichiers / répertoires
Définir les autorisations sur tous les fichiers (définit par inadvertance des autorisations incorrectes sur tous les répertoires également)

chmod 0660 / home // partagé / * -R

Définir des autorisations sur tous les répertoires

trouver / accueil // shared -type d -exec chmod 2770 +

Si au lieu de ce qui précède chmod: impossible d'accéder vous recevez -bash: / bin / chmod: liste d'arguments trop longue alors vous devez réduire la quantité de fichiers en cours de traitement en appliquant chmod à un plus petit ensemble de répertoires, en y allant quelques fois, par exemple pour /domicile// partagé / 1 / et /domicile// partagé / 2 /

Si vous avez perdu les détails de propriété du fichier en les copiant à partir d'un support au format Winows ou d'un système Linux avec différents utilisateurs, vous pouvez définir le propriétaire sur winuser (peu importe qui en fait) et le groupe au groupe d'organisation en utilisant:
chown -R winuser.-personnel / accueil //partagé/*

(Au lieu de chmod 2770 vous pouvez également utiliser chmod u + rwx, g + rwxs, o-rwx)

Le répertoire partagé finira par ressembler à ceci:
drwxrws --- 29 winadmin someorganisation-staff 4.0K 2008-06-01 17:27 partagé

Si vous souhaitez plutôt que la personne qui a créé un fichier / répertoire puisse les supprimer, définissez le bit collant à l'aide de chmod 3770 (ou chmod u + rwx, g + rwxs, o-rwx, o + t) ici et dans smb.conf.

Répertoires pour des sujets partagés spécifiques

Ceux-ci sont accessibles par les mêmes règles que pour / accueil / partagé.

Modèles

Un emplacement pour les modèles de documents partagés pour des logiciels tels que OpenOffice.

Créez le répertoire:
mkdir / maison // shared / templates

Définissez les mêmes autorisations que celles précédemment définies sur / accueil / partagé, sinon les autorisations seront déterminées par l'umask et seront donc rwxr-sr-x (si vous avez utilisé des autorisations différentes sur / accueil / partagé faites-le ici aussi). Bien que l'ID de groupe défini soit hérité de / accueil / partagé nous le redéfinissons car ne pas le spécifier le supprimerait:
chmod 2770 / home // shared / templates

Images

Un emplacement pour les images partagées (logos, photos, etc.) pour les logiciels de gestion d'images tels que Picasa.

Créez le répertoire:
mkdir / maison // partagé / images

Définissez les mêmes autorisations que celles précédemment définies sur / accueil / partagé, sinon les autorisations seront déterminées par l'umask et seront donc rwxr-sr-x (si vous avez utilisé des autorisations différentes sur / accueil / partagé faites-le ici aussi). Bien que l'ID de groupe défini soit hérité de / accueil / partagé nous le redéfinissons car ne pas le spécifier le supprimerait:
chmod 2770 / home // partagé / images

Répertoire dans lequel localiser les sous-groupes / répertoires de groupes restreints

Il s'agit d'un espace partagé auquel seul un groupe restreint de personnes peut accéder. Il sera disponible en tant que R :. Tous les utilisateurs seront attachés à R: mais seuls ceux qui sont dans des groupes particuliers peuvent voir dans le répertoire associé à chaque groupe.

(Remarque: cela nécessite les paramètres correspondants dans smb.conf et NETLOGON.BAT)

Créez un répertoire dans lequel nous placerons des répertoires de sous-groupes séparés dans:
# mkdir / home //limité

Remplacez le groupe du répertoire partagé par le groupe d'organisation (pour que tout le monde puisse se connecter à R :):
# chgrp -personnel / accueil //limité

Modifiez les autorisations afin que seul le propriétaire du répertoire ait un accès complet et que toute personne du groupe d'organisation puisse simplement accéder au répertoire (notez que le propriétaire devra être la personne pour créer le répertoire de chaque groupe restreint):
# chmod 0750 / home //limité

Répertoires partagés pour des sous-groupes particuliers / groupes restreints (le cas échéant)

Si vous avez copié des fichiers ici à l'aide de la ligne de commande et que vous vouliez définir correctement les autorisations sur tous, car ils ne le sont pas pour diverses raisons, vous pouvez les forcer à être corrects en utilisant ce qui suit:
chmod 0660 / home //limité// * -R
chmod 2770 / home //limité// * /
chmod 2770 / home //limité// * / * /
chmod 2770 / home //limité// * / * / * /
Continuez à ajouter * / jusqu'à ce qu'il indique qu'il n'y a plus de fichiers à cette profondeur pour fonctionner.
Si vous avez également perdu leur propriété en raison, par exemple, de leur copie à partir d'un support au format Winows ou d'un système Linux avec différents utilisateurs, vous pouvez définir leur propriétaire sur winuser et leur groupe au sous-groupe / groupe restreint en utilisant chown -R winuser. /domicile//limité// *

Créez des groupes pour tous les sous-groupes / groupes restreints qui sont nécessaires, en utilisant un nom descriptif (certains exemples sont «finance» pour les comptes et «archive» pour les anciens répertoires personnels du personnel):
# ajouter un groupe

Créez des répertoires partagés pour tous les sous-groupes restreints qui pourraient être requis:
# mkdir / home //limité/

Définissez le propriétaire d'un sous-groupe sur celui du sous-groupe:
# chgrp /domicile//limité/

Modifier les autorisations afin que seuls les propriétaires et ceux du même groupe puissent lire, écrire et exécuter; les nouveaux fichiers et répertoires créés dans le répertoire partagé héritent de la propriété du groupe du répertoire conteneur (correspondant smb.conf réglages: forcer le mode de création = 0660 et forcer le mode répertoire = 2770):
# chmod 2770 / home //limité/

Fichiers de base de données partagés (facultatif)

Il y a une part commentée dans smb.conf pour partager des fichiers de base de données. Ceci est basé sur les mêmes paramètres que le répertoire partagé principal, mais avec le verrouillage opportuniste de niveau 1 et de niveau 2 (OpLocks) désactivé. Certaines bases de données utilisent un fichier qui est partagé entre plusieurs utilisateurs simultanés utilisant le système d'exploitation et son système de fichiers pour gérer le partage, plutôt que d'être un système de base de données à part entière fonctionnant sur des sockets réseau. Windows met en cache le fichier lit et écrit localement pour de meilleures performances, jusqu'à ce qu'un autre poste de travail demande le fichier ou qu'il en ait fini avec. La mise en cache des fichiers par Windows n'est pas robuste, donc pour les fichiers de base de données à haute intégrité accessibles par plusieurs personnes, il y a le partage des bases de données. Les paramètres d'oplocks nous permettent d'échanger les performances pour l'intégrité, en spécifiant que ces fichiers seront écrits dans (oplocks de niveau 1) et lus (oplocks de niveau 2) directement. Non seulement les bases de données évidentes basées sur des fichiers telles que Paradox, OpenOffice, Microsoft Access, etc., méritent d'être hébergées sur ce partage, mais également une version partagée de Quickbooks et de Microsoft Outlook.

Créez un répertoire pour les fichiers partagés entre tous les membres de l'organisation (un T: pour les membres du groupe d'employés de l'organisation):
# mkdir / home //base de données

Nous changeons le propriétaire du répertoire partagé en winadmin plus tard, lorsque nous avons créé cet utilisateur.

Remplacez le groupe du répertoire partagé par le groupe d'organisation:
# chgrp -personnel / accueil //base de données

Modifiez les autorisations sur le répertoire partagé de sorte que:

  • Soit winadmin, soit n'importe qui dans le groupe d'organisation, mais personne d'autre, peut accéder au répertoire, y voir les fichiers et sous-répertoires et modifier le contenu (créer, supprimer, changer et renommer)
  • La propriété de groupe des nouveaux fichiers / répertoires créés ici sera automatiquement définie sur le même groupe que ce répertoire, le groupe d'organisation (tel que défini par set group id / setgid / SGID), et que ce paramètre, contrairement aux autres, sera hérité par sub -répertoire.

# chmod 2770 / home //base de données

Pour l'utiliser, vous devez également décommenter les [database] participer à smb.conf et T: section dans netlogon.bat.

Lectures complémentaires

C'est très descriptif: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/locking.html

http://en.wikipedia.org/wiki/Opportunistic_Locking

http://oreilly.com/catalog/samba/chapter/book/ch05_05.html

outil de référence: http://www.drouillard.biz/Tips&Tricks/Samba/Oplocks.htm

Programmes Windows installés sur le serveur (facultatif)

Créer un répertoire:
programmes mkdir / usr / windows

Définissez les autorisations:
chgrp samba-domain-admins / usr / windows-programmes
chmod 2774 / usr / programmes-windows

Installer réellement des programmes sur le serveur

TODO … mais je ne fais jamais ça de nos jours de toute façon …

Copie directe de programmes sur le serveur

TODO … mais je ne fais jamais ça de nos jours de toute façon …

Script d'ouverture de session Windows

Répertoire des scripts d'ouverture de session Windows

Créer un répertoire:
mkdir / home / samba / netlogon

Définissez des autorisations pour que tout le monde puisse accéder au répertoire:
chgrp samba-domain-admins / accueil / samba / netlogon
chmod 2777 / home / samba / netlogon

NETLOGON.BAT

TWEAK (Unattended) est utilisé par ce script de connexion, disponible sur thegoldenear.org/tweak/. Il s'agit d'une version automatisée de TWEAK pour la configuration utilisateur.

Voici un exemple de script de connexion:




:: ###########################################
:: NETLOGON.BAT - Script d'ouverture de session Windows
:: Version 2.2.0
::
:: Pour l'explication et le changelog voir
:: http://thegoldenear.org/toolbox/unices/samba-3-pdc-print-server-debian-etch.html#smb.conf
:: Ce fichier nécessite le format de nouvelle ligne Windows CR + LF pour fonctionner. Si créé
:: in Linux then use 'flip -m NETLOGON.BAT' to convert. If created in Windows
:: then subsequent editing in Linux's nano editor will auto save in CR+LF.
::
:: Uncomment P:, R:, T: or LPT1 in here and in smb.conf in order to use them.
:: ###########################################

:: H: is made by smb.conf, no need to include it here

:: P: for programs that are run from space on the server
:: (I don't use this but it's there if you need it)
:: net use P: \serverprograms

:: S: for shared area for everyone in the -staff group
net use S: \servershared

:: R: for shared area only for restricted sub-groups
:: net use R: \serverrestricted

:: T: for shared non-cached database
:: net use T: \serverdatabase

:: Sync the workstation's time to that of the file-server
:: (requires permission be set for Limited accounts to change the time)
net time \server /set /yes

:: Make connections to any printer(s)
:: net use LPT1: "\SERVER"

:: Create temporary directories for %USERNAME% on TEMP partition
if not exist "D:%username%" md "D:%username%"
if not exist "D:%username%windows" md "D:%username%windows"
if not exist "D:%username%ie" md "D:%username%ie"
if not exist "D:%username%ieTemporary Internet Files" md "D:%username%ieTemporary Internet Files"
if not exist "D:%username%firefox" md "D:%username%firefox"
if not exist "D:%username%mozilla" md "D:%username%mozilla"
if not exist "D:%username%java" md "D:%username%java"
if not exist "D:%username%nero" md "D:%username%nero"
if not exist "D:%username%audacity" md "D:%username%audacity"

:: %USERPROFILE%Start MenuProgramsstartupdesktop.ini, which is created by
:: our setting a view mode in Windows Explorer, combined with setting .ini
:: files to open in a text editor, causes desktop.ini to open in the text editor
:: on login for some people. So delete some desktop.ini files.
del "%USERPROFILE%Start Menudesktop.ini"
del "%USERPROFILE%Start MenuProgramsdesktop.ini"
del "%USERPROFILE%Start MenuProgramsstartupdesktop.ini"
del "%USERPROFILE%Application DataMicrosoftInternet ExplorerQuick Launchdesktop.ini"

:: Housekeeping - delete Windows profile directories left behind by software apps we no longer use
rmdir /S /Q "%USERPROFILE%.gimp-2.2"
rmdir /S /Q "%USERPROFILE%.gimp-2.4"
rmdir /S /Q "%USERPROFILE%.gimp-2.6"
rmdir /S /Q "%APPDATA%.gaim"
rmdir /S /Q "%APPDATA%FRISK Software"
rmdir /S /Q "%APPDATA%OpenOffice"
rmdir /S /Q "%APPDATA%OpenOffice.org"
rmdir /S /Q "%APPDATA%OpenOffice.org2"
rmdir /S /Q "%APPDATA%KompoZer"

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: This section allows automated user configuration to be performed using other scripts.
:: The example framework for doing this uses batch files from TWEAK (Unattended)
:: (http://thegoldenear.org/tweak/)

:: Create a drive mapping to the Windows admin area on the server and change to the
:: directory with the scripts so those scripts can access files in relative paths.
net use W: \serverwindows-admin /persistent:no
W:
cd "tweak-unattended"

:: When rolling out this automated config for the first time, if you have existing users who're already
:: configured, *temporarily* uncomment mark-all-user-config-as-done.bat so it can mark everyone that logs
:: in as having been configured. Later, user-config-rcs-if-not-already-done.bat 
:: won't configure anything for them.
:: (You can alter mark-all-user-config-as-done.bat so some config is applied and not other.
:: IF EXIST "mark-all-user-config-as-done.bat" call "mark-all-user-config-as-done.bat"

:: ---- Put user config here required by each new iteration of your software suite ----
:: E.g. this will induce user-config-rcs-if-not-already-done.bat to replace everyone's desktop shortcuts
:: IF NOT EXIST "%USERPROFILE%RCS36-CONFIG-DONE" del "%USERPROFILE%tweak-logrefresh-user-shortcuts.log"
:: IF NOT EXIST "%USERPROFILE%RCS36-CONFIG-DONE" mkdir "%USERPROFILE%RCS36-CONFIG-DONE"
:: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

:: Apply all config required (in this case for a Roaming Computing System user account):
IF EXIST "user-config-rcs-if-not-already-done.bat" call "user-config-rcs-if-not-already-done.bat"

:: Lose the temporary drive mapping
net use W: /delete /no
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: For debugging purposes, uncomment the pause
:: pause

Prepare it in one of two ways:

  • From Unix
    • Save it as /home/samba/netlogon/NETLOGON.BAT
    • Convert to Windows CR+LF newline format:
      flip -m /home/samba/netlogon/NETLOGON.BAT
    • Enable all users access to read it:
      chmod a+r /home/samba/netlogon/NETLOGON.BAT
  • Or from Windows
    • Log in as a domain administrator, i.e. winadmin (created later)
    • Save it as \SERVERnetlogonNETLOGON.BAT
      (it will have the Windows CR+LF newline format and correct permssions)

NETLOGON.BAT Changelog

  • 2.2.0 – 5 December 2013 – add housekeeping section to delete Windows profile directories left behind by software apps we no longer use.
  • 2.1.0 – 13 May 2013 – %USERPROFILE%Start MenuProgramsstartupdesktop.ini, which is created by setting a view mode in Windows Explorer, combined with setting .ini files to open in a text editor, causes desktop.ini to open in the text editor on login for some people. So delete some desktop.ini des dossiers
  • 2.0.0 – 19 March 2010 – added ability to automate user configuration using other batch files
  • 1.1.0 – 26 June 2009 – added commented out T: for \SERVERdatabase
  • 1.0.1 – 29 April 2009 – added commented out 'pause'
  • 1.0.0 – 17 June 2008 – added (commented out) R: for \SERVERrestricted
  • 0.9.1 – fix for Windows XP creating desktop.ini files, especially the startup one
  • 0.9.0
    • Commented out P: as it's useful but we don't currently use it
    • Removed creation of D:winnt which was long ago deprecated
    • Remove creation of D:mozilla as we nowadays use Firefox
    • Replaced creation of D:nero with D:infrarecorder

Références

The Official Samba-3 HOWTO and Reference Guide:
http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/;

Samba documentation site:
http://wiki.samba.org/

This has some info on Windows XP's differences when joining a domain:
http://www.wlug.org.nz/SambaAsPDC

Samba 3 release notes:
http://www.samba.org/samba/history/samba-3.0.0.html

HOWTO implement Samba as your PDC:
http://gentoo-wiki.com/HOWTO_Implement_Samba_as_your_PDC

For smb.conf settings see the man page (use man smb.conf) ou
http://samba.org/samba/docs/man/manpages-3/smb.conf.5.html.

Samba-3 by Example – Practical Exercises in Successful Samba Deployment – John H. Terpstra:
http://us4.samba.org/samba/docs/man/Samba-Guide/

File System Permissions at Wikipedia: http://en.wikipedia.org/wiki/File_system_permissions

User Accounts

Domain Administrators – 'winadmin'

Members of the group 'Domain Admins' are granted administrator privileges within the domain and on the workstation when they login to the domain from Windows.

The first person to add is our Windows administrative user 'winadmin':
net rpc user add winadmin -U root

Set winadmin's password:
net rpc user password winadmin "" -U root

There is a bug
where by accounts created with net rpc user add are disabled and need enabling, so do that:
smbpasswd -e winadmin

Samba will automatically create the Windows profile directory, setting the user whose profile directory it is the owner, and setting the group to users. However with our current smb.conf settings you don't have permission to save your profile there when you logout, so the smb.conf settings need to be changed to deal with this (however when you log in again it's ok.). For now we do this:

  • Make a home directory:
    mkdir /home/samba/profiles/winadmin
  • Set winadmin to be the owner of their home directory:
    chown winadmin /home/samba/profiles/winadmin

Give winadmin access to shared files on S:
adduser winadmin -staff

To add users to a Windows group we use the syntax 'net rpc group addmem "" ". It uses the smb.conf setting add user to group script. Using this, make winadmin a Domain Administrator:
net rpc group addmem "Domain Admins" winadmin -U root

Henceforth you can use the winadmin account for domain administration, such as joining a workstation to a domain, rather than the root account.

Limited – 'winuser' and Other User Accounts

Regular Windows domain (and thus Samba) accounts are Limited accounts, not in the Administrators or Power Users groups. All your user accounts should be of this type for massively increased security.

Use a consistent naming convention for your organisation's user accounts. Examples are first name; first name and first letter of surname; or role name.

As well as accounts for specific individuals, it may be useful to have 'volunteer' for trusted volunteer staff, with access to S:; and 'visitor' for untrusted people who drop in (an account called guest isn't allowed) without access to S:.

Create the winuser account (for testing and for WPKG (see later)) and any other user accounts you require using the following:
net rpc user add winuser -U root
net rpc user password winuser "" -U root
smbpasswd -e winuser
mkdir /home/samba/profiles/winuser
chown winuser /home/samba/profiles/winuser

(If you were to script the above, to save any interaction during the script you should append the net rpc user commands with %.)

Groups

If they're to have access to shared files on S: (in Unix /home/samba//shared or in Windows \servershared) add them to the organisation's group, otherwise they only have their home directory (H:):
adduser winuser -staff
(Note that users without access to S: will be prompted for logon credentials to S: when they login, which they can disregard by pressing [Enter])

If they're to have access to any restricted sub-groups on R: (in Unix /home/samba//restricted or in Windows \serverrestricted) add them to any of those specific groups, individually:
adduser winuser

Référence:

http://samba.org/samba/docs/man/Samba-HOWTO-Collection/NetCommand.html#sbeuseraddn

(Note that if you choose to use the above to write a script to create accounts for your specific users (which is more efficient and less error prone), then to save manually entering the password each time, append commands that use '-U root' with '-U root%' instead)

Power User accounts

Power User accounts are a feature of the Windows workstation, not the Samba server, see Power Users in the workstation section.

Windows Workstations and the Samba Domain Controller

Exigences

The Windows operating systems that will work in this environment are Windows 2000 Professional and Windows XP Professional. Windows XP Home, by design, will not join a domain. I don't have experience of it but I _suspect_ Windows Vista Business and Windows Vista Ultimate will work; Windows Vista Home Basic and Windows Vista Home Premium will not.

Client for Microsoft Networks.

NetBIOS over TCP/IP.

Disable LMHOSTS.

Set the WINS server address – this is most efficiently done by specifying the WINS server on your DHCP
server so workstations get it automatically but otherwise you can set it manually
(Note that WINS requires the 'remote registry service' be running in order to function)

Join the Domain

You can do this during Windows installation. If instead you already have Windows installed,
follow this procedure:

Login to the local machine as an administrative user.

Start → Control Panel → System → Network Identification → Properties → Member of → Domain – enter the domain name and choose 'OK'.

You should be prompted for a username and password with which to authenticate with the server. Enter the username winadmin and the corresponding password.

Now you can login to the domain with user accounts you've already created. Windows will automatically create a user profile on the workstation and copy it to the server when you log out. This same profile is then available at any other workstation that's joined to this domain.

S'identifier

When you login from a workstation, Windows will automatically create the user profile for you.

Windows Configuration

Our TWEAK tool incorporates most of the following
settings, and more worthwhile settings for Windows workstations.

Synchronised time.
We want the time on workstations to be synchronised with time on the server.
le net time \server /set /yes in the logon script and the time server = yes
dans smb.conf facilitate this but Restricted / Limited users aren't allowed to change the
time in Windows. To change permissions so that all authenticated users are allowed to change the time:
Control Panel → Administrative Tools → Local Security Policy → Local Policies
→ User Rights Assignment → Change the system time → double-click → Add →
choose Authenticated Users → Add → OK → OK
(Note: does anyone know the corresponding registry setting?)

Remove the Recycle Bin from the desktop. In an environment where people save files on the server it
leads people into a false sense of security to have a visible recycle bin because deleting a file from
the server just deletes it. Windows doesn't copy deleted files across the network to the local recycle
bin.
To remove the recycle bin, remove this registry entry:
HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerDesktopNamespace645FF040-5081-101B-9F08-00AA002F954E

Log users off when their roaming profile fails:
Group Policy → Local Computer Policy → Computer Configuration → Administrative Templates
→ System → Logon → Log users off when their roaming profile fails
This is the corresponding registry setting:
HKLMSOFTWAREPoliciesMicrosoftWindowsSystemProfileErrorAction = 00000001 (DWORD)

Power Users

Well-Known Entity RID SID Our Unix Group Type domain/local/builtin Objectif Essential for Samba?
Builtin Power Users 547 S-1-5-32-547 n / a Alias builtin can create local users and groups; modify and delete accounts that they have created; remove users from the Power Users/Users/Guests groups; install programs; create, manage, and delete local printers; create and delete file shares. Non

"When a Windows NT4/2000/XP client joins a domain, the domain global Domain Admins group is added to the membership of the local Administrators group on the client. Any user who is a member of the domain global Domain Admins group will have administrative rights on the Windows client. This is often not the most desirable solution because it means that the user will have administrative rights and privileges on domain servers also. The Power Users group on Windows client workstations permits local administration of the workstation alone. The Power Users group is a group that is local to each Windows 2000/2003/XP Professional workstation. Any domain global user or domain global group (i.e. Domain Users) can be added to the membership of the local workstation group Power Users."

"Because the Power Users group exists on the Windows workstation, you don't add people to it in the way we assign rights, groups and relative identifiers. It must be done in one of the following ways:"

  • Using the GUI on the Windows (XP, in this case) workstation:
    • Control Panel → User Accounts → Advanced → Advanced → Groups → Power Users → right-click → Add to group → Add…
      • Select this object type: Users or Groups
      • From this location: your domain
      • Enter the object names to select: if the correct domain is selected above then enter the username, otherwise
    • → Check Names → OK
  • Using the command-line on the Windows workstation:
    net localgroup S-1-5-32-547 /add
    [TODO: this gives « System error 1376 has occurred. The specified local group does not exist »]
  • On the server:
    net rpc group addmem "Power Users" "$1" -U %password -S $2

It's also possible to add everyone in the domain's Domain Users group to the Windows workstation's Power Users group.

Note, when using the Windows GUI on the workstation, do not use Control Panel → User Accounts → Add… → enter 'User name' and 'Domain' → Next → Other → Power Users.

Domain Account Password Change

Users can change their domain account password through normal means on their Windows workstation,
such as ctrl+alt+del → Change Password.

Mac OS X Workstations and the Samba Domain Controller

In theory Mac OS X workstations should be able to login to the domain. I know no more than that. Mac OS X includes Samba. The later the version of OS X you have the more likely this will work as the version of Samba included is constantly updated.

Printing

CUPS

Paquets

CUPS Print Queues

Setup CUPS print queues as described in
'Server Setup with Debian 4.0 'Etch''

CUPS Permissions

If Samba runs on the same host as CUPS, you only need to allow localhost to print.
If you want to run something like cupsaddsmb from a remote computer you'll need to set permissions accordingly in the
section de cupsd.conf.
Similarly if Samba and CUPS run on different machines you'll need to make sure the Samba host gets access to printing on CUPS.

If you need to, setup CUPS sharing / serving as described in
'Server Setup with Debian 4.0 'Etch''.

Samba

smb.conf Additions for Printer Serving

(We do not setup Samba for Raw CUPS printing support, where specific drivers for each printer are installed on each workstation and they print as though to a direct printer, to a raw queue; where CUPS does not try to convert documents, just sending them on in their raw, binary, form to the printer. This would require 'application/octet-stream' in /etc/cups/mime.types; 'application/octet-stream application/vnd.cups-raw 0 -' in /etc/cups/mime.convs; 'raw queue' and 'client driver' settings in smb.conf. We don't do this because instead we have simplified driver installation on clients; the risk of using buggy drivers in NT kernel mode compared with a very well tested stable PostScript driver; the ability to get statistics or apply quotas on printing.

This part goes in the [global] section of the Samba configuration file /etc/smb.conf, replacing 'printcap name = /dev/null' and 'load printers = no':




########## Printing ##########

# Also see [printers], [print$] and any printer-specific shares further on

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
   load printers = yes

# CUPS printing. CUPS should take over the print jobs for this share.
# See also the cupsaddsmb(8) manpage in the cupsys-client package.
# With 'printing' enabled, any (otherwise manually) set print command in smb.conf is ignored.
# ('printcap' is a synonym for 'printcap name')
   printing = cups
   printcap name = cups

# When using [print$], root is implicitly a 'printer admin', but you can
# also give this right to other users to add drivers and set printer
# properties
   printer admin = root, @lpadmin

This part goes at the bottom of the [global] section, before the [homes] section, of the Samba
configuration file /etc/smb.conf:




#------------ Printer shares ---------------
[printers]
# Printing defaults for all printers unless they're specified explicitly
# Printing for authenticated users, not guests.
# If you want unauthenticated printing set 'guest ok = yes / public'
   comment = All Printers
   printable = yes
   writable = yes
   browseable = yes
   public = yes
   # public should probably be no

   # Incoming spool directory.
   # Print jobs go from here to spool directory of Unix print subsystem, i.e. /var/spool/cups.
   # This directory needs to be created.
   path = /var/spool/samba
   create mode = 666 ; this is liberal so anyone can print; may be better to tighten it and set a group on the directory

   printer admin = @lpadmin


[print$]
# Windows printer driver location.
# Windows clients look for this share name as a source of downloadable printer drivers.
   comment = Printer Drivers
   path = /var/lib/samba/printers
   # location of drivers; make sure it's writable by users in write list and read/executable by others.
   browseable = yes
   read only = yes
   guest ok = no
   # Allow remote administration of Windows print drivers.
   # For users to use cupsaddsmb, they need to be represented in this write list.
   write list = root, @lpadmin
   # if you want to use root with this setting then don't have 'invalid users = root' in [global]

Rights, groups, relative identifiers and domain administrators

Counter to the other Unix groups, where we create a new group with a corresponding name and group ID
to the Windows group, for print operators we use the already existing and functionally corresponding
Unix group lpadmin. This will additionally allow Print Operators to administer through
the CUPS web interface.
Map the Windows builtin Print Operators group to the Unix lpadmin group:
net groupmap add ntgroup="Print Operators" unixgroup="lpadmin" sid="S-1-5-32-550" type=builtin -U winadmin

Assign appropriate privileges to the group:
net rpc rights grant lpadmin SePrintOperatorprivilege -U winadmin

Create print administrators

The syntax to add people to the group is:
net rpc group addmem "Print Operators" -U winadmin

Add our Windows administrator account to the print operators group:
adduser winadmin lpadmin.
(When using
net rpc group addmem "Print Operators" -U winadmin
people don't get added to the lpadmin Unix group and so can't use the CUPS web interface
– can they use the Windows interface instead?)

Can we add a group of users to the Print Operators group?
Unix doesn't support nested groups (a group being a member of another group);
supposedly Samba supports nested groups if you have winbind and NSS winbind (libnss_winbind) installed.
(Adduser and net rpc group addmem, without winbind installed, don't complain when you add one group to
another).
I don't yet see how you can add a group of users to the Print Operators group.

How do we additionally allow users to be able to use the CUPS web interface?
Adding users to the Samba/Windows Print Operators group doesn't add them to the Unix lpadmin group.
I presume the Print Operators group works when the user is using the Windows printer administration interface,
where upon it maps through to lpadmin. Because of this if you want users to be able to use the CUPS web
interface you need to additionally add them to the Unix lpadmin group (can this be automated?)

To additionally allow users to use the CUPS web interface:
adduser lpadmin

Now add any other users you want to be able to administer printers through either Windows or the CUPS
web interface, one-by-one.

Directories and Permissions

Create the Samba incoming print job directory:
mkdir /var/spool/samba

Set liberal permissions on the directory:
chmod 0777 /var/spool/samba
(we could set the group ID on this directory instead)
(corresponding smb.conf setting: [printers] create mode = 666)

Create the Windows printer driver directory (cupsaddsmb expects to find them here):
mkdir /usr/share/cups/drivers.

Set permissions on that directory such that it is readable by the user you're using cupsaddsmb avec
(probably a member of the Print Operators / lpadmin group):
chgrp lpadmin /usr/share/cups/drivers -R
chmod g+w /usr/share/cups/drivers -R

make sure the Windows driver directory (and below) is writable by the users specified by the smb.conf write list directive;
(and readable and executable by all users, but this is the default):
chgrp lpadmin /var/lib/samba/printers -R
chmod g+w /var/lib/samba/printers -R

Windows Drivers

CUPS drivers for Windows

Go to the software section of the CUPS web site at http://www.cups.org/windows/software.php and download
the source package. Extract these files from the package:

  • cups6.inf
  • cups6.ini
  • cupsps6.dll
  • cupsui6.dll

Copy the driver files there:
cp cups6.inf cups6.ini cupsps6.dll cupsui6.dll /usr/share/cups/drivers

Adobe drivers for Windows

This is the PostScript driver. This is not the PPD file.
We recommend those from Adobe because the Microsoft ones can be hard to find. Get the 'Adobe Universal PostScript Windows Driver Installer'
from http://www.adobe.com/support/downloads/detail.jsp?ftpID=1500.
There are downloads available for multiple spoken languages.
At time of writing this is version 1.0.6. The English download is called winsteng.exe.
Extract it from the current directory to the temp directory with 7-zip (first, install the p7zip-full package):
7z x winsteng.exe -o/tmp/adobe-windows-postscript-drivers.

It includes many files for various versions of Windows, these are the files for Windows 2000 and XP:

  • /Win2000/PSCRPTFE.NTF
  • /Win2000/PSCRIPT.NTF *
  • /Win2000/PSCRIPT.HLP *
  • /Win2000/PSCRIPT5.DLL *
  • /Win2000/DEFPRTR2.PPD
  • /Win2000/PS5UI.DLL *
  • /WinXP/PSCRPTFE.NTF
  • /WinXP/PSCRIPT.NTF *
  • /WinXP/PSCRIPT.HLP *
  • /WinXP/PSCRIPT5.DLL *
  • /WinXP/DEFPRTR2.PPD
  • /WinXP/PS5UI.DLL *

You want to choose files from those marked '*'. We don't want all the files because some equivalents are instead drawn from the CUPS drivers for Windows.
Note that the Windows 2000 and XP files are not identical, the DLL files differ, so we recommend using the Windows 2000 drivers so you can cope with clients
with either operating
system, because you can only choose one of these two sets of drivers and "NT5 drivers are always NT5.1 compatible (NT 5.1 drivers are very rarely NT5 compabtible,
but they can be".

Copy the driver files there:
cd /tmp/adobe-windows-postscript-drivers/Win2000
cp PSCRIPT.NTF PSCRIPT.HLP PSCRIPT5.DLL PS5UI.DLL /usr/share/cups/drivers

cupsaddsmb needs the driver filenames to be lowercase, so convert them:
rename 'y/A-Z/a-z/' /usr/share/cups/drivers/*

CUPS drivers

PPD files for each non-PostScript printer

Make sure the PPD file is in the /usr/share/cups/model directory (not a sub-directory below there).

These you should have gotten when you configured CUPS earlier when following the document
'Server Setup with Debian 4.0 'Etch''.
If the PPD file isn't available in a Debian package then see if it can be download from
http://linuxprinting.org/printer_list.cgi.

PPD files for each PostScript printer

Make sure the PPD file is in the /usr/share/cups/model directory (not a sub-directory below there).

These you should have gotten when you configured CUPS earlier when following the document
'Server Setup with Debian 4.0 'Etch''.
If the PPD file isn't available in a Debian package then see if it can be download from
http://linuxprinting.org/printer_list.cgi
and if not from there try the printer's manufacturer.

Enabling Windows drivers

Note: these instructions currently only cover Windows 2000/XP/2003 clients. It wouldn't take much to add printing support for Windows 95/98/Me by choosing
additional driver files from Adobe (not Microsoft); also bear in mind the CUPS drivers themselves are not available for Windows 95/98/Me so the Adobe (not Microsoft)
portion must be used in place of them.

Utilisation cupsaddsmb to automate transferring PostScript driver files and each printer's PPD file from CUPS to Samba's [print$] partager
(from where Windows expects to find them when using Point'n'Print (Point'n'Print means automatic download from the server and installation on the workstation))
and configure Samba using 'rpcclient adddriver' and
"rpcclient setdriver". cupsaddsmb a besoin security = user dans le smb.conf [global] section.

Export a specific printer (in verbose mode so we can see if it failed at anything):
cupsaddsmb -U winadmin -v

Export all known printers (in verbose mode so we can see if it failed at anything):
cupsaddsmb -U winadmin -v -a

Here's an example of cupsaddsmb in use:




server:/usr/share/cups/drivers# cupsaddsmb -v lamlash -U winadmin
Password for winadmin required to access localhost via SAMBA:
Running command: smbclient //localhost/print$ -N -U'winadmin%winadmin' -c 'mkdir W32X86;
put /var/spool/cups/tmp/454a0f9a251b7 W32X86/lamlash.ppd;put /usr/share/cups/drivers/ps5ui.dll W32X86/ps5ui.dll;
put /usr/share/cups/drivers/pscript.hlp W32X86/pscript.hlp;put /usr/share/cups/drivers/pscript.ntf W32X86/pscript.ntf;
put /usr/share/cups/drivers/pscript5.dll W32X86/pscript5.dll'
Domain=[ORGANISATION] OS=[Unix] Server=[Samba 3.0.14a-Debian]
NT_STATUS_OBJECT_NAME_COLLISION making remote directory W32X86
putting file /var/spool/cups/tmp/454a0f9a251b7 as W32X86/lamlash.ppd (946.0 kb/s) (average 946.0 kb/s)
putting file /usr/share/cups/drivers/ps5ui.dll as W32X86/ps5ui.dll (2540.0 kb/s) (average 1956.8 kb/s)
putting file /usr/share/cups/drivers/pscript.hlp as W32X86/pscript.hlp (541.4 kb/s) (average 1441.1 kb/s)
putting file /usr/share/cups/drivers/pscript.ntf as W32X86/pscript.ntf (1402.3 kb/s) (average 1409.6 kb/s)
putting file /usr/share/cups/drivers/pscript5.dll as W32X86/pscript5.dll (1259.1 kb/s) (average 1357.1 kb/s)

Running command: rpcclient localhost -N -U'winadmin%winadmin' -c 'adddriver "Windows NT x86" 
"lamlash:pscript5.dll:lamlash.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:pscript.ntf"'
Printer Driver lamlash successfully installed.

Running command: rpcclient localhost -N -U'winadmin%winadmin' -c 'setdriver lamlash lamlash'
Succesfully set lamlash to driver lamlash.

Références

Chapter 22 of The Official Samba-3 HOWTO and Reference Guide, CUPS Printing Support – Advanced Configuration,
describes in detail every aspect of CUPS support in Samba and how it works that you will likely
want to know, in a very readable manner that enables you to have a complete understanding of the topic from a system administrator's standpoint:
http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html#id2645046

Windows and the Print Server

Windows printer driver settings

Configure PostScript drivers as administrator before users add the printer for themselves.

Note: don't get the following menu options confused with the per-user settings in
Start → Settings → Printers → right-click on the printer → Printing Preferences
or Start → Settings → Printers → right-click on the printer → Properties →
General → Printing Preferences.

Start → Settings → Printers → right-click on the printer → Properties →
Advanced →

  • Printing Defaults →
    • Layout → Print on Both Sides (Duplex) – change 'None' to 'Flip on long edge'
    • Advanced → Document Options →
      • PostScript Options →
        • PostScript Output Option – change 'Optimize for Speed' to 'Optimize for Portability'
        • TrueType Font Download Option – ?
      • Graphic → TrueType Font – change 'Substitute with Device Font' to
        'Download as SoftFont' (however, Samba documentation says "for exotic fonts, you may need to
        change it back to get a printout at all")
  • Device Settings → Installable Options →
    • Duplex Unit – if the printer has a duplex unit change 'Not Installed' to 'Installed'
    • Memory Configuration – set this to the appropriate value for the printer
    • Installed Memory – set this to the appropriate value for the printer

Users already connected to the printer may need their own comparitive settings changing
in ?.

De
http://samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html#cups-avoidps1.

Windows Administration Area

Samba Settings

These are the Samba settings you need to add at the bottom of the smb.conf file:

[windows-admin]
   
   
   
   comment = Windows administration and package deployment
   path = /usr/windows-admin
   read only = yes
   browseable = yes
   write list = @samba-domain-admins
   # New files created here are forced to have these permissions
   force create mode = 0660
   # New directories created here are forced to have these permissions
   force directory mode = 2770

Restart Samba:
/etc/init.d/samba restart

Répertoires

Create a directory for software deployment tools:
mkdir /usr/windows-admin

Make the directory a member of the group samba-domain-admins / Windows Domain Admins, rather than root:
chgrp samba-domain-admins /usr/windows-admin

Set permissions to additionally give samba-domain-admins write access and that new files/directories will be owned by the samba-domain-admins group; (Note that WPKG uses the winuser account to access the packages here); permissions will then be rwxrwsr-x:
chmod g+wxs /usr/windows-admin

Make a directory for Windows administration tools (i.e. JkDefrag, CloneZilla, GParted Live):
mkdir /usr/windows-admin/tools

Set permissions to additionally give samba-domain-admins write access; permissions will then be rwxrwsr-x:
chmod g+w /usr/windows-admin/tools

Make a directory for storing workstation clone images (i.e. from CloneZilla) in:
mkdir /usr/windows-admin/images

Set permissions to additionally give samba-domain-admins write access, and people other than root and members of samba-domain-admins no access; permissions will then be rwxrws---:
chmod g+w,o-rx /usr/windows-admin/images

Copy An Existing Tools Directory From Another Machine (Optional)

You can copy an existing tools directory from another machine, using the command-line, across a network, to a new server.

Either copy from a machine you're currently logged in to with a tools directory, to a remote new server:
scp -rqv /usr/windows-admin/tools/* root@:/usr/windows-admin/tools/
Or copy from a remote machine with a tools directory, to a new server you're currently logged in to:
scp -rqv root@:/usr/windows-admin/tools/* /usr/windows-admin/tools/

Set permissions on the files you copied:
chmod g+w /usr/windows-admin/tools -R

Set the group owner to samba-domain-admins as it's useful to be able to work with these files whilst logged into Windows as winadmin:
chgrp samba-domain-admins /usr/windows-admin/tools -R

Windows software deployment

WPKG – Windows Package Management

"WPKG is an automated software deployment, upgrade and removal program for Windows. It can be used to push/pull software packages, such as Service Packs, hotfixes, or program installations from a central server (for example, Samba or Active Directory) to a number of workstations. It can run as a service to install software in the background (silent install), without user interaction."

Répertoires

Create a directory for WPKG:
mkdir /usr/windows-admin/wpkg

Create a directory for WPKG packages:
mkdir /usr/windows-admin/wpkg/packages

Create a directory for tools to use with WPKG package management:
mkdir /usr/windows-admin/wpkg/tools
We keep things in here such as unzip.exe which is used when installing Firefox and Thunderbird
extensions / add-ons

Set permissions to additionally give samba-domain-admins write access; permissions will then be rwxrwsr-x (allowing WPKG to use the winuser account to access package installers here):
chmod g+w /usr/windows-admin/wpkg -R
(If you'd created these directories by connecting from Windows via Samba then this would have already been the case but we're connecting through Unix)

Configure WPKG

Download WPKG ('server') and save to /usr/windows-admin/wpkg/

Download WPKG Client installer and save to /usr/windows-admin/wpkg/ so it can be manually installed on workstations from \serverwindows-adminwpkgWPKG Client

Write your own packages.xml, profiles.xml et hosts.xml files and save them to /usr/windows-admin/wpkg/

Save various application installers in their own directories in /usr/windows-admin/wpkg/packages/

Save any application-specific installer configuration files with their application installers in /usr/windows-admin/wpkg/packages/.

Delete WPKG's 'hôtes' and 'profiles' directories (in /usr/windows-admin/wpkg/) so that room1 et room2 sample XML files aren't processed on each workstation startup

sauvegarder wpkg-client-settings.xml à \serverwindows-adminwpkgWPKG Client and insert your system's specific winuser password by installing WPKG Client onto one workstation, loading this file into it, adding the password manually then re-exporting the configuration over the copy of the file on the server. This will be manually loaded into WPKG Client during other workstation setup.

Copy An Existing WPKG Installation (Optional)

You can copy an existing WPKG installation, using the command-line, across a network, to a new server.

Either copy from a machine you're currently logged in to with an existing WPKG installation, to a remote new server:
scp -rqv /usr/windows-admin/wpkg/* root@:/usr/windows-admin/wpkg/
Or copy from a remote machine with an existing WPKG installation, to a new server you're currently logged in to:
scp -rqv root@:/usr/windows-admin/wpkg/* /usr/windows-admin/wpkg/

Set permissions on the files you copied (permissions on directories will then be rwxrwsr-x, permissions on files will then be rwxrw-r--):
chmod g+w /usr/windows-admin/wpkg -R

Set the group owner to be samba-domain-admins as it's useful to be able to work with these files whilst logged into Windows as winadmin:
chgrp samba-domain-admins /usr/windows-admin/wpkg -R

Entretien

Keep a copy of the Samba domain SID, because if it changes for some reason then the workstations will need re-authenticating with the domain. You can display the domain SID using: net getlocalsid.

"All persistent tdb files should be regularly backed up. Use the tdbbackup utility to backup the tdb files. All persistent tdb files must be preserved during machine migrations, updates and upgrades.". The tdb files live in /var/lib/samba/ and are account_policy.tdb, ntdrivers.tdb, ntprinters.tdb, secrets.tdb, group_mapping.tdb, ntforms.tdb, passdb.tdb, registry.tdb et share_info.tdb. The backup command might be tdbbackup *.tdb, I'm not yet sure. Alternatively you could just copy them somewhere.

Dépannage

Techniques for troubleshooting Samba permissions issues:
'Debugging Samba: Deciphering Access Denied by Jack Loftus' –
http://searchenterpriselinux.techtarget.com/tip/0,289483,sid39_gci1270003,00.html

Check you haven't made any basic syntactic errors in smb.conf: testparm.

Show open ports and whether they listen on just localhost or for remote connections:
netstat -l -t -p

Users

List users: net rpc user (optionally giving user to connect as)

Info on a particular user: net rpc user info

List a user's properties: pdbedit -c -u

List users in a particular group, for example Domain Admins:
net rpc group members "Domain Admins" -U

List all users, including machine accounts, giving extended information:
pdbedit -Lv

List all Unix accounts: getent passwd

List users in domain: wbinfo -u

List groups in domain: wbinfo -g

Test whether a particular user can connect to a Samba share:
smbclient \\server\shared -U

Delete a user account:
net rpc user delete

If someone cannot access a shared directory, check they're in the correct Unix group, i.e.
-staff, with cat /etc/group

Groups

List current group map: net groupmap list.

To delete a group mapping:
net groupmap delete ntgroup="" -U winadmin.
If you mistakenly have more than one with the same name but different SIDs then you instead use:
net groupmap delete sid="" -U winadmin

Machines / Workstations

List all machine / workstation accounts (and user accounts) in a simple list:
pdbedit -L

List all machine / workstation accounts (and user accounts) giving extended information:
pdbedit -Lv

Delete a machine account:
pdbedit --delete --machine -u
(alternatively you can use pdbedit -x -u )
This leaves an entry in /etc/passwd, which isn't removed using net rpc delete, but is removed with userdel $

Enregistrement

tail -f /var/log/samba/log. – see what's happening when users do things such as log in

tail -f /var/log/samba/log.nmbd – logs server side of things such as when joining the domain

tail -f /var/log/syslog

You can adjust the verbosity of Samba's log on quite a fine grain, using smb.conf's 'log level' setting with any of these parameters: all, tdb, printdrivers, lanman, smb, rpc_parse, rpc_srv, rpc_cli, passdb, sam, auth, winbind, vfs, idmap, quota, acls, locking, msdfs, dmapi, registry. For example 'log level = 3 passdb:5 auth:10 winbind:2". The default log level is 0.

Divers

"Check if Samba 'sees' the printer, for example either this way:
# rpcclient transmeta -N -U'root%password' -c 'enumprinters 0' | grep ir85wm
Or this way:
# rpcclient transmeta -N -U'root%password' -c 'getprinter ir85wm'
cmd = getprinter ir85wm
flags:[0x800000]
name:[\transmetair85wm]
description:[\transmetair85wm,ir85wm,DPD]
comment:[CUPS PostScript-Treiber for Windows NT/200x/XP]
"

If, when issuing commands that interact with Samba, such as net, you get errors such as:
Could not connect to server 127.0.0.1
Connection failed: NT_STATUS_CONNECTION_REFUSED

and:
Connection to localhost failed (Error NT_STATUS_CONNECTION_REFUSED)
Failed to add user 'winadmin' with: Failed to connect to IPC$ share on localhost.

Then this could be because you have another server within reach with the same name.

Gotchas

  • Beware what gets into the part of your Windows user profile that is transferred across the network each time you login and logout. Par exemple:
    • Thunderbird mail is stored in %APPDATA%
    • Some programs save their cached files in %APPDATA% rather than in %TEMP% (i.e. Sun JRE)
    • Don't save large files on the desktop
    • a U3 flash drive saves its payload into %APPDATA%
  • xcopy /O doesn't work when files reside on a Samba server.
  • When batch files check for the existence or not of a directory, using 'if exist' or 'if not exist', if the directory is being checked for on a Windows system then the batch file needs to use 'NUL.ext', if the directory is being checked for on a Linux Samba system (at least Samba 3.2.x) then the batch file needs to use 'NUL'.

Bugs in this Document

Can't create Print Operators with net command

It takes a couple of minutes before a new Samba user account becomes usable, before then
it is claimed it is disabled. When you use 'smbclient \\server\shared -U pete' it says "session setup failed: NT_STATUS_ACCOUNT_DISABLED". When you try to login on a workstation it says "Your account has been disabled. Please see your system administrator."

I'd rather use the winadmin account for all admin but smbpasswd -e won't work unless you're root because you can't specify other users to run smbpasswd with '-U winadmin' or use it for this kind of operation unless you're root.

We should only disable smb.confc'est invalid users = root temporarily to allow us to use the root account to setup the system. Then restart Samba. Turning this back off when you're done. This needs to be re-assessed now that we're using Debian 4.0 Etch.

Bugs in Upstream Packages

http://www.samba.org/samba/docs/man/Samba3-HOWTO/NetCommand.html implies you can create Unix accounts with spaces which you can't:

	
	
	
	"The following demonstrates that the POSIX (UNIX/Linux system account) group
	has been created by calling the 
	add group script = /opt/IDEALX/sbin/smbldap-groupadd -p "%g" interface script:
	root#  getent group
...
	Domain Admins:x:512:root"

/usr/share/doc/samba-doc/htmldocs/speed.html is referenced but there's no such document.

smb.conf les usages passwd chat et passwd program but I replaced that with pam passwd change = yes to get passwd syncing working.

There's no mention in the net man page of net rpc group addmem ou net rpc group delmem.

The cupsaddsmb man page (http://cups.org/doc-1.2/man-cupsaddsmb.html) needs to mention this too. You need to include a step before "Once you have extracted the driver files" to say to use p7zip.

(I don't know how to convert to lowercase when using p7zip, as one would use the -L switch with unzip).

bug: what is this on about?: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html#id2645046:
"Recognizing Different Driver Files – Note – If both the Adobe driver files and the CUPS driver files for the support of Windows NT/200x/XP are presently installed on the server, the Adobe files will be ignored and the CUPS files will be used. If you prefer for whatever reason to use Adobe-only drivers, move away the three CUPS driver files. The Windows 9x/Me clients use the Adobe drivers in any case."

Bug: The cupsaddsmb man page in Debian doesn't say if when using CUPS driver you still need to get Microsoft drivers and that these need to be gotten from a Windows system. The online man page from CUPS does: http://www.cups.org/doc-1.2/man-cupsaddsmb.html.

CUPS should say which Adobe drivers to use if you have both Windows 2000 and XP clients

CUPS Bugs Reported

bug STR #2038: The cupsaddsmb man page (http://cups.org/doc-1.2/man-cupsaddsmb.html) says "The base driver for Windows 2000 and higher is the Microsoft PostScript
driver, which is available on any system running Windows 2000 or higher in the %WINDOWS%SYSTEM32SPOOLDRIVERSW32X863 folder."
The "%WINDOWS%" location doesn't exist on any version of Windows that I know of. What you mean is %WINDIR%.

bug STR #2039: The cupsaddsmb man page (http://cups.org/doc-1.2/man-cupsaddsmb.html) says "The base driver for Windows 2000 and higher is the Microsoft PostScript driver,
which is available on any system running Windows 2000 or higher in the %WINDOWS%SYSTEM32SPOOLDRIVERSW32X863 folder."
This directory is empty on Windows XP. If you try to install them using the add printer drivers dialog, there appears to be no such driver available.

bug STR #2040: Trying to download CUPS drivers for Windows, you're presented with a page with options for 'Source Code', and 'Binaries'. The CUPS drivers are mixed up in
the source code downloads and the binaries section says see the source code for the binaries. It would be a lot easier to follow if the binaries section had a download
package for just the binary drivers.

bug STR #2041: The CUPS drivers for Windows described in the cupsaddsmb man page are cups6.inf, cups6.ini, cupsps6.dll and cupsui6.dll. However the CUPS drivers for
Windows include cups6.ppd, for which there's no mention.
[(maybe it’s the « the « cups » device (essential to print to non-PS printers from CUPS)]

bug STR #2042: include Adobe driver for Windows 2000 and XP.
The cupsaddsmb man page (http://cups.org/doc-1.2/man-cupsaddsmb.html) says "However, currently only Windows 2000 and higher is supported by the Microsoft driver, so you
will also need to get the Adobe driver to support Windows 95, 98, and Me clients. The Adobe and Microsoft drivers for Windows 2000 are identical."

– It seems the Microsoft driver is too difficult (for me) to find. Adobe have drivers for both Windows 95/98/Me and Windows 2k/XP drivers in the form of the 'Adobe
Universal PostScript Windows Driver Installer' (http://www.adobe.com/support/downloads/product.jsp?product=44&platform=Windows) – winsteng.exe. The cupsaddsmb man page
says the 95/98/Me drivers are available from Adobe, recomending people use the Microsoft ones for 2000/XP. Please also say that there exists Adobe drivers for Windows
2000/XP and preferably even recommend them rather than the Microsoft ones as they seem simpler to find.

Adobe's description of the driver package is this: "The Adobe Universal PostScript Windows Driver Installer installs the latest version of the AdobePostScript (AdobePS)
driver for each supported Microsoft Windows platform:
– AdobePS 4.5.3: Windows 95, Windows 98, Windows 98 Second Edition, or Windows Millennium Edition
– AdobePS 5.2.2: Windows NT 4.0
– PScript 5: Windows 2000 or Windows XP "

Also, when the cupsaddsmb man page describes how to locate the Adobe driver for Windows 95/98/Me, it says to go to http://www.adobe.com. The link used above,
http://www.adobe.com/support/downloads/product.jsp?product=44&platform=Windows, provides direct links to drivers for all supported operating systems in all supported
languages, so is a better place to link people to than http://www.adobe.com.

bug STR #2043: 7z not unzip for unzipping self-extracting zip files.
http://www.cups.org/doc-1.1/sam.html says "If you download the Adobe drivers, use the free unzip software to extract the files from the self-extracting ZIP file
containing the drivers;". As far as I can tell the free unzip software doesn't unzip from self-extracting zip files. If it does can you please include in the
documentation the switch by which to do so. If it actually doesn't then you should recommend using p7zip instead, i.e. using '7z x winsteng.exe'. On Debian the package
name is p7zip-full.

To Do

Need to read: Sample smb.conf Add Group Script –
http://www.samba.org/samba/docs/man/Samba3-HOWTO/groupmapping.html#id2568922

See the comments in here: Debian Administration – Debian, CUPS, Samba… Days of grief:
http://www.debian-administration.org/articles/300

This page describes creating Windows profiles automatedly:
http://www.hughesjr.com/content/view/26/2/Site_News

Some administration can be done from a Windows workstation rather than on the server.
For example, to delete a samba user account: net user /delete /domain

User Profile Hive Cleanup Service – http://www.microsoft.com/downloadS/details.aspx?FamilyID=1b286e6d-8912-4e18-b570-42470e2f3582&displaylang=en – when logging out, a user's session may not properly terminate, this service monitors sessions and ensures they're terminated properly.

To Do – Printing

Setting up printers on workstations manually




"11. (Optional.) Tickle the driver into a correct device mode.

It is important that you execute this step as a Samba printer admin (as defined in smb.conf). Here is 
another method to do this on Windows XP. It uses a command line, which you may type into the "DOS box" 
(type root's smbpassword when prompted):

C:> runas /netonly /user:root "rundll32 printui.dll,PrintUIEntry 
	/in /n \sambaservermysmbtstprn"

Change any printer setting once (like changing portrait to landscape), click on Apply, and change the 
setting back.

12. Install the printer on a client (Point'n'Print).

C:> rundll32 printui.dll,PrintUIEntry /in /n "\sambaservermysmbtstprn"

If it does not work, it could be a permissions problem with the [print$] share."


"Samba and UNIX obviously do not have such a Registry"
- as elsewhere, lower case 'registry'

"Nowadays, most Linux distributions rely on the utilities from the Linuxprinting.org to create their 
printing-related software"

"The utilities from this sire have a very end-user-friendly interface"

"while the new-style PPDs are now call foomatic-rip"

"Save foomatic-rip either directly in /usr/lib/cups/filter/foomatic-rip or somewhere in your $PATH" - 
shouldn't you also say peope with distros will want to use their distro's method

"From CUPS 1.1.16 and later releases, you can use the CUPS PostScript driver for Windows NT/200x/XP 
clients (which is tagged in the download area of http://www.cups.org/ as the cups-samba-1.1.16.tar.gz 
package)"

"This is the best system currently available, and there are huge improvements under development for 
CUPS 1.2:"
- so it would be good to brand this document as correct as per a specific version of CUPS

"Shut all Explorer Windows."
- windows

Manually Installing the PostScript Driver on a Client

"install the CUPS printer PPD on top of the Adobe PostScript driver on clients. Then point the client's printer queue to the Samba printer share for a UNC type of connection:
C:> net use lpt1: \sambaserverprintershare /user:ntadmin
Should you desire to use the CUPS networked PostScript RIP functions. (Note that user "ntadmin" needs to be a valid Samba user with the required privileges to access the printershare.) This sets up the printer connection in the traditional LanMan way (not using MS-RPC)."

Administrator Cannot Install Printers for All Local Users

"Windows XP handles SMB printers on a "per-user" basis. This means every user needs to install the printer himself or herself. To have a printer available for everybody, you might want to use the built-in IPP client capabilities of Win XP. Add a printer with the print path of
http://cupsserver:631/printers/printername. We're still looking into this one. Maybe a logon script could
automatically install printers for all users.

Click to rate this post!
[Total: 0 Average: 0]

Commentaires

Laisser un commentaire

Votre commentaire sera révisé par les administrateurs si besoin.