Oft wurde das Thema behandelt und selten finde ich mich zurecht, wenn ich andere Howtos lese. Hier ist nun meine Version.
Das hier eingerichtet System hat folgende Komponenten:
LDAP
apt-get install slapd ldap-utilsFragen zu slapd
nobuerovs.internexample_organization<administrative LDAP password>BDBnono
SAMBA
apt-get install samba samba-doc
Nun wird die Schemadatei von Samba für LDAP kopiert:
cp /usr/share/doc/samba-doc/examples/LDAP/samba.schema.gz /etc/ldap/schema/ cd /etc/ldap/schema/ gunzip samba.schema.gz
SAMBA
Das Programm passwd nutzt die Konfigurationsdatei /etc/nsswitch.conf um herauszufinden, welche Passwörter zu ändern sind. Damit es LDAP „versteht“, muß die entsprechende Bibliothek installiert werden.
apt-get install libnss-ldapFragen zu libnss-ldap
ldap://192.168.0.194/dc=buerovs,dc=intern3neinjaneincn=admin,dc=buerovs,dc=intern<secret>
SAMBA
Damit Samba auch mit LDAP zusammenarbeiten kann, benötigt man weitere Pakete:
apt-get install smbldap-tools
Die Konfiguration beginnt mit dem Samba Server, obwohl noch keine Anbindung an LDAP besteht. Dieses ist sinnvoll, da so alle weiteren Änderungen sich direkt auf Samba auswirken.
SAMBA
Die für Samba wichtige Konfigurationsdatei ist etc/samba/smb.conf. Sollte bereit eine vorhanden sein, kann man sie sichern und eine leere neue Datei anlegen:
cd /etc/samba mv smb.conf smb.conf.orig touch smb.conf
man smb.conf) nachgelesen werden.
Nun werden zunächst die allgemeinen Einstellungen getätigt.
[global] ## Browsing/Identification ### netbios name = lserver netbios aliases = bueroserver buerovslserver workgroup = buerovs server string = PDC %h (Samba %v) wins support = yes name resolve order = lmhosts host wins bcast
#### Networking #### ; interfaces = 127.0.0.0/8 eth0 ; bind interfaces only = true ; hosts allow = 10.0.0.0/24 10.1.0.0/24 10.2.0.0/24
#### Debugging/Accounting #### # This tells Samba to use a separate log file for each machine # that connects ; log file = /var/log/samba/log.%m max log size = 1000 log level = 0 syslog only = no syslog = 0 # Do something sensible when Samba crashes: mail the admin a backtrace panic action = /usr/share/samba/panic-action %d
####### Authentication ####### # "security = user" is always a good idea. This will require a Unix account # in this server for every user accessing the server. See # /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html # in the samba-doc package for details. security = user encrypt passwords = true null passwords = no # Never use this option: you will not add windows hosts to domain! ; invalid users = root passwd chat = *new*password* %n\n *new*password* %n\n *changed* ; passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* . passdb backend = ldapsam:ldap://<IP-to-LDAP-Server/ ldap passwd sync = yes ldap delete dn = Yes ldap admin dn = cn=admin,dc=buerovs,dc=intern ; ldap admin dn = cn=samba,ou=DSA,dc=buerovs,dc=intern ldap suffix = dc=buerovs ldap group suffix = ou=Groups ldap user suffix = ou=Users ldap machine suffix = ou=Computers ldap idmap suffix = ou=Users add machine script = /usr/sbin/smbldap-useradd -w "%u" add user script = /usr/sbin/smbldap-useradd -m "%u" add group script = /usr/sbin/smbldap-groupadd -p "%g" add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g" delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g" set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u" ; guest account = nobody
########## Domains ########### local master = yes os level = 65 preferred master = yes domain master = yes domain logons = yes # The following required a [profiles] share logon path = \\%L\profiles\%U # It specifies the location of a user's home directory (from the client # point of view) logon drive = Z: logon home = \\%L\%U # It specifies the script to run during logon. The script must be stored # in the [netlogon] share # NOTE: Must be store in 'DOS' file format convention logon script = logon.cmd hide unreadable = yes hide dot files = yes
############ Misc ############ dos charset = 850 unix charset = UTF-8 # Using the following line enables you to customise your configuration # on a per machine basis. The %m gets replaced with the netbios name # of the machine that is connecting ; include = /home/samba/etc/smb.conf.%m # Most people will find that this option gives better performance. # See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/speed.html # for details # You may want to add the following on a Linux system: # SO_RCVBUF=8192 SO_SNDBUF=8192 socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
Die weiteren Abschnitte sind für die Anmeldung an der Domäne:
[netlogon] comment = Network Logon Service path = /home/samba/netlogon public = no writable = no browsable = no ; guest ok = yes share modes = no
# The path below should be writable by all users so that their # profile directory may be created the first time they log on [profiles] comment = Users profiles path = /home/samba/profiles guest ok = no browseable = no writable = yes ; write list = create mask = 0600 directory mask = 0700 default case = lower preserve case = no case sensitive = no
[homes] comment = Home Directories path = /home/%U/.windows_home create mask = 0700 directory mask = 0700 browseable = no writable = yes valid users = %S public = no guest ok = no inherit permissions = yes
Damit für einen neuen Benutzer das Windows Home-Verzeichnis auch vorhanden ist, muß dieses in /etc/skel/ angelegt werden:
mkdir /etc/skel/.windows_home
Man kann die Konfiguration mit dem Programm testparam prüfen. Das ist aber keine 100%ige Garantie!
LDAP
Für die Konfiguration des LDAP Server muß als erstes die Datei /etc/ldap/slapd.conf editiert werden:
####################################################################### # Global Directives: # Features to permit #allow bind_v2 # Schema and objectClass definitions include /etc/ldap/schema/core.schema include /etc/ldap/schema/cosine.schema include /etc/ldap/schema/nis.schema include /etc/ldap/schema/inetorgperson.schema include /etc/ldap/schema/samba.schema schemacheck on # Where the pid file is put. The init.d script # will not stop the server if you change this. pidfile /var/run/slapd/slapd.pid # List of arguments that were passed to the server argsfile /var/run/slapd/slapd.args loglevel 1480 #loglevel 0 # Where the dynamically loaded modules are stored modulepath /usr/lib/ldap moduleload back_bdb # The maximum number of entries that is returned for a search operation #sizelimit unlimited sizelimit 500 # default # The tool-threads parameter sets the actual amount of cpu's that is used # for indexing. tool-threads 1
#######################################################################
# Specific Backend Directives for bdb:
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
backend bdb
checkpoint 512 30
# Specific Directives for database #1, of type bdb:
# Database specific directives apply to this databasse until another
# 'database' directive occurs
database bdb
# The base of your directory in database #1
suffix "dc=buerovs,dc=intern"
# rootdn directive for specifying a superuser on the database. This is needed
# for syncrepl.
rootdn "cn=admin,dc=buerovs,dc=intern
# Where the database file are physically stored for database #1
directory "/var/lib/ldap"
# For the Debian package we use 2MB as default but be sure to update this
# value if you have plenty of RAM
dbconfig set_cachesize 0 2097152 0
# Sven Hartge reported that he had to set this value incredibly high
# to get slapd running at all. See http://bugs.debian.org/303057
# for more information.
# Number of objects that can be locked at the same time.
dbconfig set_lk_max_objects 1500
# Number of locks (both requested and granted)
dbconfig set_lk_max_locks 1500
# Number of lockers
dbconfig set_lk_max_lockers 1500
# Indexing options for database #1
index objectClass,uidNumber,gidNumber eq
index cn,sn,uid,displayName pres,sub,eq
index memberUid,mail,givenname eq,subinitial
index sambaSID,sambaPrimaryGroupSID,sambaDomainName eq
# Save the time that the entry gets modified
lastmod on
# Where to store the replica logs
# replogfile /var/lib/ldap/replog
# Use MD5-Hashes of Unix passwords
password-hash {crypt}
password-crypt-salt-format "$1$%.8s"
# ACLs...
access to dn.base="" by * read
# The admin dn has full write access, everyone else
# can read everything.
access to *
by dn="cn=admin,dc=buerovs,dc=intern" write
by self read
by * readNun muß das Passwort des LDAP Administrators verschlüsselt in die Datei eingetragen werden:
echo "rootpw " $(slappasswd -h {SSHA} -s meinpasswort) >> /etc/ldap/slapd.conf
SAMBA
Als nächstes sorgen wir dafür, daß Samba den Zugriff auf LDAP erhält:
smbpasswd -w meinpasswort Output... Setting stored password for "cn=admin,dc=buerovs" in secrets.tdb
Nich klar wo es notwendig ist.
Da auch andere Dienste auf LDAP zugreifen, muß man eine LDAP Client Konfiguration erstellen:
HOST 127.0.0.1 BASE dc=buerovs,dc=intern
SAMBA
Nun wird dem System die Nutzen- und Gruppenkonten, die im LDAP gespeichert werden, bekannt gemacht. Dieses ist notwendig, damit die UIDs und GIDs zugeordnet werden können. Hier ist nur der wichtige Ausschnitt der Datei, die gesamte Datei kann man hier herunterladen.
# This is the configuration file for the LDAP nameservice
# switch library and the LDAP PAM module.
#
# The distinguished name of the search base.
base dc=buerovs,dc=intern
# Another way to specify your LDAP server is to provide an
uri ldap://192.168.0.194/
# The LDAP version to use (defaults to 3
# if supported by client library)
ldap_version 3
# The distinguished name to bind to the server with. Optional: default is to
# bind anonymously. Please do not put double quotes around it as they would be
# included literally.
binddn cn=admin,dc=buerovs,dc=intern
bindpw meinpasswort
# The distinguished name to bind to the server with if the effective user ID is
# root. Password is stored in /etc/libnss-ldap.secret (mode 600)
# Use 'echo -n "mypassword" > /etc/libnss-ldap.secret' instead of an editor to
# create the file.
rootbinddn cn=admin,dc=buerovs,dc=intern
pam_password md5
# RFC2307bis naming contexts
# Syntax:
# nss_base_XXX base?scope?filter
# where scope is {base,one,sub}
# and filter is a filter to be &'d with the default filter.
# You can omit the suffix eg:
# nss_base_passwd ou=People,
# to append the default base DN but this may incur a small performance impact.
nss_base_passwd ou=Users,dc=buerovs,dc=intern?one
nss_base_passwd ou=Computers,dc=buerovs,dc=intern?one
nss_base_shadow ou=Users,dc=buerovs,dc=intern?one
nss_base_group ou=Groups,dc=buerovs,dc=intern?one
Der Zusatz ?one bewirkt, daß maximal eine Antwort vom LDAP-Server zurückgeliefert wird.
Damit das System nach den angeforderten Einträgen sucht, muß die Datei /etc/nsswitch.conf angepaßt werden:
passwd: compat ldap group: compat ldap shadow: compat ldap
Die Erweiterung bewirkt, daß die Suche nach Einträgen auf dem LDAP-Server fortgesetzt wird, wenn keine in den Dateien gefunden wurden.
SAMBA
Diese Tools verknüpfen Samba und den LDAP Server. Dazu müssen die Passwörter angegeben werden.
<file|/etc/smbldap-tools/smbldap_bind.conf> slaveDN=„cn=admin,dc=buerovs,dc=intern“ slavePw=„meinpasswort“ masterDN=„cn=admin,dc=buerovs,dc=intern“ masterPw=„meinpasswort“ </file>
Diese Datei muß noch vor dem Zugriff anderer geschützt werden.
chmod 0400 /etc/smbldap-tools/smbldap_bind.conf
Es muß noch die /etc/smbldap-tools/smbldap.conf editiert werden. Sollte keine vorhanden sein, so kann man sie aus dem doc-Vereichnis kopieren. Hier kann man die gesamte Datei herunterladen.
Um die SID in dieser Datei auf den korrekten Wert zu setzten, muß man den Wert erst auslesen:
net getlocalsid
# smbldap-tools.conf : Q & D configuration file for smbldap-tools
##############################################################################
#
# General Configuration
#
##############################################################################
# Put your own SID. To obtain this number do: "net getlocalsid".
# If not defined, parameter is taking from "net getlocalsid" return
SID="S-1-5-21-938990727-2293754504-940761264"
sambaDomain="BUEROVS"
##############################################################################
#
# LDAP Configuration
#
##############################################################################
# Slave LDAP server
slaveLDAP="192.168.0.194"
slavePort="389"
# Master LDAP server: needed for write operations
masterLDAP="192.168.0.194"
masterPort="389"
# Use TLS for LDAP
ldapTLS="0"
verify="require"
# CA certificate
cafile="/etc/opt/IDEALX/smbldap-tools/ca.pem"
clientcert="/etc/opt/IDEALX/smbldap-tools/smbldap-tools.pem"
clientkey="/etc/opt/IDEALX/smbldap-tools/smbldap-tools.key"
# LDAP Suffix
suffix="dc=buerovs,dc=intern"
# Where are stored Users
usersdn="ou=Users,${suffix}"
# Where are stored Computers
computersdn="ou=Computers,${suffix}"
# Where are stored Groups
groupsdn="ou=Groups,${suffix}"
# Where are stored Idmap entries (used if samba is a domain member server)
idmapdn="ou=Idmap,${suffix}"
# Where to store next uidNumber and gidNumber available for new users and groups
sambaUnixIdPooldn="sambaDomainName=BUEROVS,${suffix}"
# Default scope Used
scope="sub"
# Unix password encryption (CRYPT, MD5, SMD5, SSHA, SHA, CLEARTEXT)
hash_encrypt="CRYPT"
# if hash_encrypt is set to CRYPT, you may set a salt format.
crypt_salt_format="$1$%.8s"
##############################################################################
#
# Unix Accounts Configuration
#
##############################################################################
# Default Login Shell
userLoginShell="/bin/bash"
# Home directory
userHome="/home/%U"
# Default mode used for user homeDirectory
userHomeDirectoryMode="700"
# Gecos
userGecos="System User"
# Default User (POSIX and Samba) GID
defaultUserGid="513"
# Default Computer (Samba) GID
defaultComputerGid="515"
# Skel dir
skeletonDir="/etc/skel"
# Default password validation time (time in days)
defaultMaxPasswordAge="365"
##############################################################################
#
# SAMBA Configuration
#
##############################################################################
## leere Strings bedeutet, daß der Wert aus der smb.conf gelesen wird!
# The UNC path to home drives location ('logon home')
userSmbHome=""
# The UNC path to profiles locations ('logon path')
userProfile=""
# The default Home Drive Letter mapping
userHomeDrive="Z:"
# The default user netlogon script name (%U username substitution)
# make sure script file is edited under dos
userScript="logon.cmd"
# Domain appended to the users "mail"-attribute when smbldap-useradd -M
mailDomain="buerovs.intern"
##############################################################################
#
# SMBLDAP-TOOLS Configuration (default are ok for a RedHat)
#
##############################################################################
with_smbpasswd="0"
smbpasswd="/usr/bin/smbpasswd"
with_slappasswd="0"
slappasswd="/usr/sbin/slappasswd"
# no_banner="1"Nachdem alles eingestellt ist, muß die Struktur für den Samba PCD in LDAP angelegt werden.
smbldap-populate
Bisher ist alles so konfiguriert, daß die verschiedenen Dienste oder Programme immer das admin-Passwort des LDAP-Nutzers kennen muß. Da dieses zu Sicherheitsproblemen führen kann, wird im folgenden beschreiben, wie man verschiedene „Systemnutzer“ und Passwörter nutzern und erstellen kann.
Jeder Dienst, der die LDAP-Daten nutzen möchte, erhält ein eigenes Zugriffskonto. Dieses betrifft
LDAP
Dazu muß eine .ldif Datei mit den benötigten Informationen erstellt werden:
dn: ou=DSA,dc=buerovs,dc=intern objectClass: top objectClass: organizationalUnit ou: DSA description: security accounts for LDAP clients dn: cn=samba,ou=DSA,dc=buerovs,dc=intern objectclass: organizationalRole objectClass: top objectClass: simpleSecurityObject userPassword: sambasecretpwd cn: samba dn: cn=nssldap,ou=DSA,dc=buerovs,dc=intern objectclass: organizationalRole objectClass: top objectClass: simpleSecurityObject userPassword: nssldapsecretpwd cn: nssldap dn: cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern objectclass: organizationalRole objectClass: top objectClass: simpleSecurityObject userPassword: smbldapsecretpwd cn: smbldap-tools
Diese Datei muß in LDAP importiert werden:
ldapadd -x -h localhost -D "cn=admin,dc=buerovs,dc=intern" -f ldap-security.ldif -W
Jetzt sind die Datein eingetragen. Die Passwörter sind allerdings im Klartext eingetragen. Aus Sicherheitsgründen ändert man dieses mit Hilfe der folgenden Befehle:
ldappasswd -x -h localhost -D "cn=admin,dc=buerovs,dc=intern" -s sambasecretpwd -W cn=samba,ou=DSA,dc=buerovs,dc=intern ldappasswd -x -h localhost -D "cn=admin,dc=buerovs,dc=intern" -s nssldapsecretpwd -W cn=nssldap,ou=DSA,dc=buerovs,dc=intern ldappasswd -x -h localhost -D "cn=admin,dc=buerovs,dc=intern" -s smbldapsecretpwd -W cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern
SAMBA
Als erstes muß die Samba LDAP Werkzeuge angepaßt werden. Dazu müssen folgende Werte angepaßt werden:
slaveDN="cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern" slavePw="smbldapsecretpwd" masterDN="cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern" masterPw="smbldapsecretpwd"
SAMBA
Anschließend muß die Samba Konfigurationsdatei abgeändert werden:
ldap admin dn = cn=samba,ou=DSA,dc=buerovs,dc=intern
Jetzt müssen die Änderungen dem Samba Server bekannt gegeben werden:
smbpasswd -w sambasecretpwd
LDAP
Es müssen ACLs für die neuen Konten definiert werden. Dafür gelten folgende Regeln:
access to * Regel geschrieben werden.
Einrückungen müssen eingehalten werden!
access to dn.base="" by * read # users can authenticate and change their password access to attrs=userPassword,sambaNTPassword,sambaLMPassword,sambaPwdLastSet,sambaPwdMustChange by dn="cn=admin,dc=buerovs,dc=intern" write by dn="cn=samba,ou=DSA,dc=buerovs,dc=intern" write by dn="cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern" write by dn="cn=nssldap,ou=DSA,dc=buerovs,dc=intern" write by self write by anonymous auth by * none # some attributes need to be readable anonymously so that # ’id user’ can answer correctly access to attrs=objectClass,entry,homeDirectory,uid,uidNumber,gidNumber,memberUid by dn="cn=samba,ou=DSA,dc=buerovs,dc=intern" write by dn="cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern" write by * read # somme attributes can be writable by users themselves access to attrs=description,telephoneNumber,roomNumber,homePhone,loginShell,gecos,cn,sn,givenname by dn="cn=samba,ou=DSA,dc=buerovs,dc=intern" write by dn="cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern" write by self write by * read # some attributes need to be writable for samba access to attrs=cn,sambaLMPassword,sambaNTPassword,\ sambaPwdLastSet,sambaLogonTime,sambaLogoffTime,\ sambaKickoffTime,sambaPwdCanChange,sambaPwdMustChange,\ sambaAcctFlags,displayName,sambaHomePath,sambaHomeDrive,\ SambaLogonScript,sambaProfilePath,description,\ sambaUserWorkstations,sambaPrimaryGroupSID,sambaDomainName,\ sambaMungedDial,sambaBadPasswordCount,sambaBadPasswordTime,\ sambaPasswordHistory,sambaLogonHours,sambaSID,sambaSIDList,\ sambaTrustFlags,sambaGroupType,sambaNextRid,sambaNextGroupRid,\ sambaNextUserRid,sambaAlgorithmicRidBase,sambaShareName,\ sambaOptionName,sambaBoolOption,sambaIntegerOption,\ sambaStringOption,sambaStringListoption by dn="cn=samba,ou=DSA,dc=buerovs,dc=intern" write by dn="cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern" write by self read by * none # samba need to be able to create the samba domain account access to dn.base="dc=buerovs,dc=intern" by dn="cn=samba,ou=DSA,dc=buerovs,dc=intern" write by dn="cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern" write by * none # samba need to be able to create new users account access to dn="ou=Users,dc=buerovs,dc=intern" by dn="cn=samba,ou=DSA,dc=buerovs,dc=intern" write by dn="cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern" write by * none # samba need to be able to create new groups account access to dn="ou=Groups,dc=buerovs,dc=intern" by dn="cn=samba,ou=DSA,dc=buerovs,dc=intern" write by dn="cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern" write by * none # samba need to be able to create new computers account access to dn="ou=Computers,dc=buerovs,dc=intern" by dn="cn=samba,ou=DSA,dc=buerovs,dc=intern" write by dn="cn=smbldap-tools,ou=DSA,dc=buerovs,dc=intern" write by * none
SAMBA
Auch diese Datei muß angepaßt werden:
binddn cn=nssldap,ou=DSA,dc=buerovs,dc=intern bindpw nssldapsecretpwd # This must be cleartext
Dieses Web-Frontend braucht man, um Computer-, Benutzer- und Gruppenkonten in einem LDAP-Verzeichnis zu bearbeiten.
Der Einfachheit halber, nutzen wir die aktuellen Pakete von Debian. Es ist aber auch kein Problem die tar.gz Pakete von http://lam.sourceforge.net zu laden.
apt-get install ldap-account-manager php4-mcrypt php4-mhash
LDAP (Aber auch überall anders möglich.)
Damit es mit dem oben abgeänderten LDAP-Server zusammenarbeiten kann, müssen Änderungen vorgenommen werden.
Als erstes ruft man es im Browser auf: http://192.168.0.194/lam/
Man wählt im Browser den Link “LAM configuration“ (oben rechts), dann “Edit server profiles“. Das Standardpasswort heißt „lam“ und ermöglicht den Zugang zur Konfiguration.
Servereinstellungen
ldap://localhost:389dc=buerovs,dc=intern5Accounttypen und -module
Editieren durch den Button Module editieren
inetOrgPerson, posixAccount, sambaSamAccountposixGroup, sambaGroupMappingaccount, posixAccount, sambaSamAccountsambaDomainEditieren durch den Button Accounttypen editieren
ou=Users,dc=buerovs,dc=internou=Groups,dc=buerovs,dc=internou=Computers,dc=buerovs,dc=internsambaDomainName=BUEROVS,dc=buerovs,dc=internUID-Bereiche für Unix-Accounts
10000300005000060000CRYPTSamba 3 Einstellungen
GMT+1GID-Bereiche für Unix-Gruppen
1000020000Scripteinstellungen
192.168.0.195/usr/local/bin/lamdaemon.plSicherheitseinstellungen
cn=admin,dc=buerovs,dc=internposixAccount“ und “uid“ hinzugefügt werden: … ;uid=support,ou=Users,dc=buerovs,dc=internNun können diese Einstellungen gespeichert werden!
Dieser Dienst ermöglicht es, daß man über den LAM die Homeverzeichnisse neuer Benutzer einrichten, alter Benutzer löschen und zum Beispiel Quotaeinstellungen vornehmen kann.
Auf dem System, auf welchem die Einstellungen ausgeführt werden – also in der Regel auf dem System, auf welchem das Homeverzeichnis liegt – muß der lamdeamon installiert sein.
Diese Datei befindet sich unter /usr/share/ldap-account-manager/lib/lamdaemon.pl und kann von dort kopiert werden.
Auf dem System, auf dem der LAM installiert ist, müssen libssh2 und SSH2 for PHP installiert werden. Da diese nicht im Paketsystem vorhanden sind, muß ein wenig Handarbeit ran.
Die Quellpakete findet man hier: http://www.libssh2.org. Man kann sie im Verzeichnis /usr/src ablegen und dort entpacken. Alternativ gibt es das Paket mittlerweile im Unstable Baum von Debian. Dieses läßt sich ohne weiteres auch in etch installieren.
Aus dem Quellcode erstellen
./configure && make all install
Paket installieren
dpkg -i libssh2-0_0.14+20070102-1_i386.deb
Auch dieses gibt es nicht als Paket und muß so auf andere Weise beschafft werden. Um pecl nutzen zu können, benötigt man noch das Paket php-pear.
pecl install ssh2-beta
Anschließend muß man diese PHP-Erweiterung in der php.ini aktivieren:
<file| /etc/php4/apache2/php.ini>
## Zeile 558
extension=ssh2.so
</file>
Auf dem Zielsystem benötigt der Benutzer Root-Rechte. Dieses ermöglicht man am besten mit sudo.
<file bash| /etc/sudoers> support ALL= NOPASSWD: /usr/local/bin/lamdaemon.pl </file>
Desweiteren muß das Zielsystem mittels PasswordAuthentification per SSH2 erreichbar sein.
Da der Admin-Benutzer von LDAP bei mir keinen echten UNIX-Account hat, muß der Support-Benutzer Schreibrechte bekommen. Dazu ändert man die erste ACL der slapd.conf fogendermaßen ab:
<file| /etc/ldap/slapd.conf> access to *
by dn="cn=admin,dc=buerovs,dc=intern" write
by dn="uid=support,ou=Users,dc=buerovs,dc=intern" write
by self read
by * read
</file>
Mit Hilfe von Profilen, kann man sich die Arbeit vereinfachen, neue Benutzer, Gruppen usw. anzulegen. Die Profile beinhalten ein Set von Einstellungen, die bei der Erstellung von zum Beispiel Benutzern geladen werden können.
Die Seiten zum Anlegen von Profilen kann man im Bereich “Werkzeuge“ (oben links) und dann ““Profileditor“ erreichen.
Im Feld “Benutzer“ “Neues Profil erstellen“ aktivieren und “Ok“ klicken.
LDAP
ou=Users,dc=buerovs,dc=internuidUnix
buerovsDomain Users, schreiben/home/$user/bin/bashSamba 3
checkuncheckuncheckcheck1.1.2030Z:\\LSERVER\$user\\LSERVER\profiles\$userlogon.cmdBUEROVSDomänenbenutzer
Profilname: BuerovsStd
Wenn man sich einlogget, dann sind nun zwei Benutzer zu sehen (nobody, root). Beide sind wichtig und dürfen daher nicht gelöscht werden.
Benutzer –> Neuer Benutzer –> Profil laden BuerovsStd “Profil laden“
Persönlich
SupportSupportUnix
supportSupport Nutzer<leer> (Es wird automatisch die nächste freie Nummer gewählt - siehe Konfiguration)<leer>buerovsSamba 3
“Allgemein“ –> “Account erstellen“
UNIX (klicken)
schreiben (muß angegeben werden!)<leer> (Es wird automatisch die nächste freie Nummer gewählt - siehe Konfiguration)Zugriff auf alle DokumenteSamba 3
schreibenDann wieder auf “Allgemein“ und “Gruppe anlegen“ klicken.
passwd