Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2006-06-14 18:46:45
Size: 1492
Editor: Kurgan
Comment:
Revision 3 as of 2007-04-11 12:44:40
Size: 4817
Editor: Kurgan
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
= PROCEDURA NON COLLAUDATA! = = PROCEDURA COLLAUDATA SOLO UNA VOLTA! =
Line 5: Line 5:
Questa procedura descrive le operazioni necessarie per sostituire un server (PDC con Samba 3.0.14a) con un nuovo computer. si tratta di una sostituzione in blocco, quindi il nuovo server prende il posto del vecchio e il vecchio viene spento. Questa procedura descrive le operazioni necessarie per sostituire un server (PDC con Samba 3.0.14a) con un nuovo computer con samba 3.0.24. si tratta di una sostituzione in blocco, quindi il nuovo server prende il posto del vecchio e il vecchio viene spento.
Line 22: Line 22:
=== Copia dei dati di config dalla vecchia macchina a quella nuova ===
Line 23: Line 24:
 * Fermare samba su tutti e due i server
Line 24: Line 26:
  * utenti Linux (con gli stessi UID)
  * gruppi Linux (con gli stessi GID)
  * tutta /etc/samba
  * tutta /var/lib/samba
  * utenti e gruppi Linux (con gli stessi UID e GID). NOTA: Nella mia prova con pochi utenti, ho ricreato a mano i gruppi e gli utenti con gli stessi GID e UID. Questo va fatto sia per gli utenti che per gli account delle macchine nel dominio (quelli che finiscono in "$"). Dovendone fare di piu`, e` meglio trovare un altro sistema.
  * tutta /etc/samba (richiede ovviamente aggiustamenti se, per dire, cambia l'hostname)
  * tutti i files "*.tdb" da /var/lib/samba
Line 31: Line 32:
 * Verificare il SID del server nuovo, e se e` cambiato causa cambio dell'hostname, reimpostarlo.  * Verificare il SID del server nuovo, e se e` nullo o cambiato causa cambio dell'hostname, reimpostarlo. Nota: nella mia prova, in cui ho cambiato hostname del server, ma non nome del dominio, ho dovuto reimpostarlo.
Line 33: Line 34:
net setlocalsid <SID> net setlocalsid <SID del vecchio che avevi salvato in sid.txt>
Line 35: Line 36:
 * Verificare se il mapping dei gruppi e` ancora a posto (gruppi, mapping, SID dei gruppi uguali a come erano prima)
 * Verificare se gli utenti sono a posto (dominio, SID, GID, home)
 * Verificare se il mapping dei gruppi e` ancora a posto (gruppi, mapping, SID dei gruppi uguali a come erano prima). Nota: nella mia prova lo erano.
 * Verificare se gli utenti sono a posto (dominio, SID, GID, home) Nota: nella mia prova lo erano, pero` non avevo gruppi strani oltre a users, guests e admins.

=== Problema del mapping dei gruppi ===

In Samba 3.0.24 la generazione dei GID dei gruppi che non siano stati definiti con "net groupmap" e` cambiata. Quindi se si migra da un server vecchio a uno con 3.0.23 o superiore occorre fare bene attenzione a quanto segue:

The user and group internal management routines have been
rewritten to prevent overlaps of assigned Relative Identifiers
(RIDs). In the past the has been a potential problem when either
manually mapping Unix groups with the 'net groupmap' command or
when migrating a Windows domain to a Samba domain using 'net rpc
vampire'.

Unmapped users are now assigned a SID in the S-1-22-1 domain and
unmapped groups are assigned a SID in the S-1-22-2 domain.
Previously they were assign a RID within the SAM on the Samba
server. For a DC this would have been under the authority of the
domain SID where as on a member server or standalone host, this
would have been under the authority of the local SAM (hint: net
getlocalsid).

The result is that any unmapped users or groups on an upgraded
Samba domain controller may be assigned a new SID. Because the
SID rather than a name is stored in Windows security descriptors,
this can cause a user to no longer have access to a resource for
example if a file was copied from a Samba file server to a local
NTFS partition. Any files stored on the Samba server itself will
continue to be accessible because Unix stores the Unix gid and not
the SID for authorization checks.

A further example will help illustrate the change. Assume that a
group named 'developers' exists with a Unix gid of 782 but this
user does not exist in Samba's group mapping table. it would be
perfectly normal for this group to be appear in an ACL editor.
Prior to 3.0.23, the group SID might appear as
S-1-5-21-647511796-4126122067-3123570092-2565. With 3.0.23, the
group SID would be reported as S-1-22-2-782. Any security
descriptors associated with files stored on an NTFS disk partition
would not allow access based on the group permissions if the user
was not a member of the
S-1-5-21-647511796-4126122067-3123570092-2565 group. Because this
group SID not reported in a user's token is S-1-22-2-782, Windows
would fail the authorization check even though both SIDs in some
respect referred to the same Unix group.

The current workaround is to create a manual domain group mapping
entry for the group 'developers' to point at the
S-1-5-21-647511796-4126122067-3123570092-2565 SID.

Migrazione di un PDC samba3 da un server a uno nuovo

PROCEDURA COLLAUDATA SOLO UNA VOLTA!

Questa procedura descrive le operazioni necessarie per sostituire un server (PDC con Samba 3.0.14a) con un nuovo computer con samba 3.0.24. si tratta di una sostituzione in blocco, quindi il nuovo server prende il posto del vecchio e il vecchio viene spento.

Backup delle informazioni

  • Salvare il SID del vecchio server (non si sa mai)
    net getlocalsid > sid.txt
  • Salvare l'elenco dei mapping dei gruppi del vecchio server
     net groupmap list > gruppi.txt
  • Salvare l'elenco degli utenti del vecchio server (questo va bene per riferimento ma non posso usarlo per ricaricare gli utenti, quindi va bene se gli utenti sono pochi e possono essere, in caso di casini, corretti a mano. Se non fosse cosi`, occorre esportare in XML)
     pdbedit -L -v > users.txt

Copia dei dati di config dalla vecchia macchina a quella nuova

  • Fermare samba su tutti e due i server
  • Copiare dal server vecchio a quello nuovo:
    • utenti e gruppi Linux (con gli stessi UID e GID). NOTA: Nella mia prova con pochi utenti, ho ricreato a mano i gruppi e gli utenti con gli stessi GID e UID. Questo va fatto sia per gli utenti che per gli account delle macchine nel dominio (quelli che finiscono in "$"). Dovendone fare di piu`, e` meglio trovare un altro sistema.
    • tutta /etc/samba (richiede ovviamente aggiustamenti se, per dire, cambia l'hostname)
    • tutti i files "*.tdb" da /var/lib/samba
  • Se occorre, modificare hostname e indirizzo ip del server nuovo
  • Lanciare Samba sul server nuovo
  • Verificare il SID del server nuovo, e se e` nullo o cambiato causa cambio dell'hostname, reimpostarlo. Nota: nella mia prova, in cui ho cambiato hostname del server, ma non nome del dominio, ho dovuto reimpostarlo.
    • net setlocalsid <SID del vecchio che avevi salvato in sid.txt>
  • Verificare se il mapping dei gruppi e` ancora a posto (gruppi, mapping, SID dei gruppi uguali a come erano prima). Nota: nella mia prova lo erano.
  • Verificare se gli utenti sono a posto (dominio, SID, GID, home) Nota: nella mia prova lo erano, pero` non avevo gruppi strani oltre a users, guests e admins.

Problema del mapping dei gruppi

In Samba 3.0.24 la generazione dei GID dei gruppi che non siano stati definiti con "net groupmap" e` cambiata. Quindi se si migra da un server vecchio a uno con 3.0.23 o superiore occorre fare bene attenzione a quanto segue:

The user and group internal management routines have been rewritten to prevent overlaps of assigned Relative Identifiers (RIDs). In the past the has been a potential problem when either manually mapping Unix groups with the 'net groupmap' command or when migrating a Windows domain to a Samba domain using 'net rpc vampire'.

Unmapped users are now assigned a SID in the S-1-22-1 domain and unmapped groups are assigned a SID in the S-1-22-2 domain. Previously they were assign a RID within the SAM on the Samba server. For a DC this would have been under the authority of the domain SID where as on a member server or standalone host, this would have been under the authority of the local SAM (hint: net getlocalsid).

The result is that any unmapped users or groups on an upgraded Samba domain controller may be assigned a new SID. Because the SID rather than a name is stored in Windows security descriptors, this can cause a user to no longer have access to a resource for example if a file was copied from a Samba file server to a local NTFS partition. Any files stored on the Samba server itself will continue to be accessible because Unix stores the Unix gid and not the SID for authorization checks.

A further example will help illustrate the change. Assume that a group named 'developers' exists with a Unix gid of 782 but this user does not exist in Samba's group mapping table. it would be perfectly normal for this group to be appear in an ACL editor. Prior to 3.0.23, the group SID might appear as S-1-5-21-647511796-4126122067-3123570092-2565. With 3.0.23, the group SID would be reported as S-1-22-2-782. Any security descriptors associated with files stored on an NTFS disk partition would not allow access based on the group permissions if the user was not a member of the S-1-5-21-647511796-4126122067-3123570092-2565 group. Because this group SID not reported in a user's token is S-1-22-2-782, Windows would fail the authorization check even though both SIDs in some respect referred to the same Unix group.

The current workaround is to create a manual domain group mapping entry for the group 'developers' to point at the S-1-5-21-647511796-4126122067-3123570092-2565 SID.

Samba/Samba3Migration (last edited 2014-05-22 20:23:23 by Kurgan)