Difference between revisions of "Cool Solution - Sync Users and Groups into a second Domain"

From Univention Wiki

Jump to: navigation, search
(Move to KB)
Tag: Replaced
 
(47 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Version|UCS=4.3}}
+
This page has been moved to the Knowledge Base Cool Solutions in the Forum.
{{Cool Solutions Disclaimer|Repository=yes}}
 
{{#seo:
 
|title={{#replace:{{#replace:{{#replace:{{#replace:{{FULLPAGENAME}}|'|'}}|&|&}}|"|"}}|Cool Solution - |}} - {{SITENAME}}
 
<!--|description=-->
 
}}
 
{{Review-Status}}
 
  
 +
[https://help.univention.com/t/cool-solution-sync-users-and-groups-into-a-second-domain/ Cool Solution - Sync Users and Groups into a second Domain]
  
This article describes, how to import Users and Groups from one domain into a second through a synchronisation system. This article will keep our target system synchron with changes done on our source system (One-Way Synchronization).<br>
+
[[Category:EN]]
We will assume that our external target system isn't able to reach our internal source system, but our internal source system has SSH access the other way around. This solution is especially helpful to keep a system in a DMZ environment up-to-date with user and group changes in an internal, inaccessible UCS environment. Both systems are allowed to have different LDAP bases.
+
[[Category:Howtos]]
 
 
{{TOC}}
 
 
 
== Installation ==
 
 
 
We first have to install two packets. One on our internal source UCS system and one on your target one.
 
 
 
Install the source package on the internal source UCS system:
 
<pre>
 
univention-install univention-user-group-sync-source
 
</pre>
 
And install the sink package on your external target UCS system:
 
<pre>
 
univention-install univention-user-group-sync-sink
 
</pre>
 
 
 
== Configuration ==
 
 
 
We will now configure our connection. All configurations can be done through UCR attributes on our internal UCS source system.<br>
 
The following attributes on our source system have to be set first. The contained variable ''$IDENTIFIER'' has to be replaced with an unique identifier name:
 
{| class=wikitable
 
! UCR variable || Description
 
|-
 
|<code>ldap/sync/source/$IDENTIFIER/sink/filter</code>  || LDAP Filter for sink <identifier>, that will filter all wanted users and groups out of the source system.<br>'''Note:''' This variable can be empty, but it has to be set. Connections with empty filters will use the following filters to guarantee to only synchronize users and groups:<br>
 
<code>(|(&(objectClass=posixGroup)(objectClass=univentionGroup))(objectClass=posixAccount))</code>
 
|-
 
|<code>ldap/sync/source/$IDENTIFIER/sink/address</code> || Hostname or IP address of our target UCS system, to which we shall synchronize to
 
|-
 
|<code>ldap/sync/source/$IDENTIFIER/sink/user</code>    || User name for data transfer, with which we can connect to the target UCS system through SSH
 
|-
 
|<code>ldap/sync/source/$IDENTIFIER/sink/pwdfile</code> || Path to password file for data transfer to the target UCS system, which contains the password of the transfer user
 
|}
 
 
 
At last, we will have to create a cron job to trigger our synchronization of our two UCS systems. We will use the following two UCR variables to define it:
 
{| class=wikitable
 
! UCR variable || Description
 
|-
 
|<code>cron/ldap-sync-$IDENTIFIER/time</code>    || The cron job time, which specifies the execution time in Cron syntax (default every 5 minutes: ''*/5 * * * *'')
 
|-
 
|<code>cron/ldap-sync-$IDENTIFIER/command</code> || The cron job command, which synchronizes the UCS systems (default: see below)
 
|}
 
 
 
We will, again, replace the ''$IDENTIFIER'' with the chosen unique identifier name. Use the following code as your cron job command. The only thing that has to be modified is the variable ''IDENT'' on the beginning:
 
<pre>
 
IDENT='$IDENTIFIER' && univention-ssh-rsync \
 
$(ucr get ldap/sync/source/$IDENT/sink/pwdfile) --remove-source-files --ignore-missing-args \
 
/var/lib/univention-user-group-sync-source/$IDENT/* \
 
$(ucr get ldap/sync/source/$IDENT/sink/user)@$(ucr get ldap/sync/source/$IDENT/sink/address):/var/lib/univention-user-group-sync-sink/ \
 
&& univention-ssh $(ucr get ldap/sync/source/$IDENT/sink/pwdfile) \
 
$(ucr get ldap/sync/source/$IDENT/sink/user)@$(ucr get ldap/sync/source/$IDENT/sink/address) univention_user_group_sync_sink.py
 
</pre>
 
 
 
Now, our source package will write all LDAP changes into files below the ''/var/lib/univention-user-group-sync-source/$IDENT/'' folder, which will be synchronized by our cron job and again be imported by our sink package.
 

Latest revision as of 14:43, 29 May 2019

This page has been moved to the Knowledge Base Cool Solutions in the Forum.

Cool Solution - Sync Users and Groups into a second Domain

Personal tools